using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace VOL.Core.Migrations { public partial class init062 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Ai_TrainingData", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校Code"), Code = table.Column(type: "nvarchar(100)", nullable: true, comment: "AI设备的唯一编码"), GradeId = table.Column(type: "int", nullable: false, comment: "年级编号"), ClassId = table.Column(type: "int", nullable: false, comment: "班级Id"), GradeName = table.Column(type: "nvarchar(100)", nullable: true, comment: "年级名称"), ClassName = table.Column(type: "nvarchar(100)", nullable: true, comment: "班级名称"), StudentCount = table.Column(type: "int", nullable: false, comment: "班级人数"), TeacherId = table.Column(type: "int", nullable: false, comment: "老师Id"), TeacherPhone = table.Column(type: "varchar(11)", nullable: true, comment: "老师手机号"), ModeType = table.Column(type: "int", nullable: false, comment: "模式类型"), ModelName = table.Column(type: "nvarchar(100)", nullable: true, comment: "模式名称"), TrainingModule = table.Column(type: "int", nullable: false, comment: "训练模块"), CategoryValue = table.Column(type: "int", nullable: false, comment: "项目类型"), StartTime = table.Column(type: "datetime", nullable: true, comment: "开始时间"), EndTime = table.Column(type: "datetime", nullable: true, comment: "结束时间"), TotalNumber = table.Column(type: "int", nullable: false, comment: "参与人数"), TotalRound = table.Column(type: "int", nullable: true, comment: "总轮次"), LimitTime = table.Column(type: "int", nullable: false, comment: "限时"), LimitNumber = table.Column(type: "int", nullable: false, comment: "限数"), TrainingType = table.Column(type: "int", nullable: true, comment: "标准赛类型"), TrainingTime = table.Column(type: "int", nullable: true, comment: "训练倒计时时间 (1, 2 分钟)"), TotalTime = table.Column(type: "int", nullable: true, comment: "限时限数总耗时") }, constraints: table => { table.PrimaryKey("PK_Ai_TrainingData", x => x.Id); }); migrationBuilder.CreateTable( name: "Ai_TrainingDetailsData", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), StudentNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学号"), StudentName = table.Column(type: "nvarchar(100)", nullable: true, comment: "姓名"), Sex = table.Column(type: "int", nullable: false, comment: "学校Co性别de"), Value = table.Column(type: "float", nullable: false, comment: "测试成绩"), MotionDuration = table.Column(type: "int", nullable: false, comment: "运动时长/分钟"), Consumption = table.Column(type: "int", nullable: false, comment: "运动消耗"), Strength = table.Column(type: "int", nullable: false, comment: "运动强度"), Score = table.Column(type: "float", nullable: false, comment: "得分"), AdditionalScore = table.Column(type: "float", nullable: false, comment: "附加分"), Rank = table.Column(type: "int", nullable: false, comment: "训练成绩等级"), RankStr = table.Column(type: "nvarchar(100)", nullable: true, comment: "等级"), ErrorNumber = table.Column(type: "int", nullable: true, comment: "错误个数"), CorrectNumber = table.Column(type: "int", nullable: true, comment: "正确个数"), MaxValue = table.Column(type: "int", nullable: true, comment: "最大"), MinValue = table.Column(type: "int", nullable: true, comment: "最小"), EvaluationGrade = table.Column(type: "int", nullable: false, comment: "测评等级"), TrainingDataId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Ai_TrainingDetailsData", x => x.Id); table.ForeignKey( name: "FK_Ai_TrainingDetailsData_Ai_TrainingData_TrainingDataId", column: x => x.TrainingDataId, principalTable: "Ai_TrainingData", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Ai_TrainingDetailsData_TrainingDataId", table: "Ai_TrainingDetailsData", column: "TrainingDataId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Ai_TrainingDetailsData"); migrationBuilder.DropTable( name: "Ai_TrainingData"); } } }