using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace VOL.Core.Migrations { public partial class init064 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Ai_Result"); migrationBuilder.DropTable( name: "Ai_TrainingDetailsData"); migrationBuilder.DropColumn( name: "StudentCount", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "TotalNumber", table: "Ai_TrainingData"); migrationBuilder.AddColumn( name: "AdditionalScore", table: "Ai_TrainingData", type: "float", nullable: false, defaultValue: 0.0, comment: "附加分"); migrationBuilder.AddColumn( name: "Consumption", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "运动消耗"); migrationBuilder.AddColumn( name: "CorrectJudge", table: "Ai_TrainingData", type: "nvarchar(4000)", nullable: true, comment: "动作解析"); migrationBuilder.AddColumn( name: "CorrectNumber", table: "Ai_TrainingData", type: "int", nullable: true, comment: "正确个数"); migrationBuilder.AddColumn( name: "Duration", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "持续时间"); migrationBuilder.AddColumn( name: "ErrorNumber", table: "Ai_TrainingData", type: "int", nullable: true, comment: "错误个数"); migrationBuilder.AddColumn( name: "MaxValue", table: "Ai_TrainingData", type: "int", nullable: true, comment: "最大"); migrationBuilder.AddColumn( name: "MinValue", table: "Ai_TrainingData", type: "int", nullable: true, comment: "最小"); migrationBuilder.AddColumn( name: "MotionDuration", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "运动时长/分钟"); migrationBuilder.AddColumn( name: "Rank", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "训练成绩等级"); migrationBuilder.AddColumn( name: "RankStr", table: "Ai_TrainingData", type: "nvarchar(100)", nullable: true, comment: "等级"); migrationBuilder.AddColumn( name: "Remark", table: "Ai_TrainingData", type: "nvarchar(4000)", nullable: true, comment: "设备评价语"); migrationBuilder.AddColumn( name: "Score", table: "Ai_TrainingData", type: "float", nullable: false, defaultValue: 0.0, comment: "得分"); migrationBuilder.AddColumn( name: "Sex", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "学校Co性别de"); migrationBuilder.AddColumn( name: "Strength", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "运动强度"); migrationBuilder.AddColumn( name: "StudentName", table: "Ai_TrainingData", type: "nvarchar(100)", nullable: true, comment: "姓名"); migrationBuilder.AddColumn( name: "StudentNo", table: "Ai_TrainingData", type: "nvarchar(100)", nullable: true, comment: "学号"); migrationBuilder.AddColumn( name: "UniqueId", table: "Ai_TrainingData", type: "bigint", nullable: false, defaultValue: 0L, comment: "设备上传成绩时唯一标识, 重复时服务端不保存数据"); migrationBuilder.AddColumn( name: "Value", table: "Ai_TrainingData", type: "float", nullable: false, defaultValue: 0.0, comment: "测试成绩"); migrationBuilder.AddColumn( name: "WrongResults", table: "Ai_TrainingData", type: "float", nullable: true, comment: "错误成绩"); migrationBuilder.CreateTable( name: "Ai_ActivitiestData", 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设备的唯一编码"), ActivitiesId = table.Column(type: "int", nullable: false, comment: "活动Id"), UniqueId = table.Column(type: "bigint", nullable: false, comment: "设备上传成绩时唯一标识, 重复时服务端不保存数据"), 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: "限时限数总耗时"), 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: "附加分"), Height = table.Column(type: "float", nullable: true, comment: "身高"), Weight = table.Column(type: "float", nullable: true, 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: "最小"), Remark = table.Column(type: "nvarchar(4000)", nullable: true, comment: "设备评价语"), Duration = table.Column(type: "int", nullable: false, comment: "持续时间"), WrongResults = table.Column(type: "float", nullable: true, comment: "错误成绩"), CorrectJudge = table.Column(type: "nvarchar(4000)", nullable: true, comment: "动作解析") }, constraints: table => { table.PrimaryKey("PK_Ai_ActivitiestData", x => x.Id); }); migrationBuilder.CreateTable( name: "Ai_LevelExamData", 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设备的唯一编码"), UniqueId = table.Column(type: "bigint", nullable: false, comment: "设备上传成绩时唯一标识, 重复时服务端不保存数据"), 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: "班级名称"), TeacherId = table.Column(type: "int", nullable: false, comment: "老师Id"), TeacherPhone = table.Column(type: "varchar(11)", nullable: true, comment: "老师手机号"), SpecialId = table.Column(type: "int", nullable: false, comment: "专项类型Id"), StartTime = table.Column(type: "datetime", nullable: true, comment: "开始时间"), EndTime = table.Column(type: "datetime", nullable: true, comment: "结束时间"), 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: "测试成绩"), Score = table.Column(type: "float", nullable: false, comment: "得分"), AssessmentResults = table.Column(type: "int", 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: "运动强度"), 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: "最小"), Remark = table.Column(type: "nvarchar(4000)", nullable: true, comment: "设备评价语"), Duration = table.Column(type: "int", nullable: false, comment: "持续时间"), WrongResults = table.Column(type: "float", nullable: true, comment: "错误成绩"), CorrectJudge = table.Column(type: "nvarchar(4000)", nullable: true, comment: "动作解析") }, constraints: table => { table.PrimaryKey("PK_Ai_LevelExamData", x => x.Id); }); migrationBuilder.CreateTable( name: "Ai_SportsTestData", 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设备的唯一编码"), UniqueId = table.Column(type: "bigint", nullable: false, comment: "设备上传成绩时唯一标识, 重复时服务端不保存数据"), 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: "限时限数总耗时"), 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: "附加分"), Height = table.Column(type: "float", nullable: true, comment: "身高"), Weight = table.Column(type: "float", nullable: true, 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: "最小"), Remark = table.Column(type: "nvarchar(4000)", nullable: true, comment: "设备评价语"), Duration = table.Column(type: "int", nullable: false, comment: "持续时间"), WrongResults = table.Column(type: "float", nullable: true, comment: "错误成绩"), CorrectJudge = table.Column(type: "nvarchar(4000)", nullable: true, comment: "动作解析") }, constraints: table => { table.PrimaryKey("PK_Ai_SportsTestData", x => x.Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Ai_ActivitiestData"); migrationBuilder.DropTable( name: "Ai_LevelExamData"); migrationBuilder.DropTable( name: "Ai_SportsTestData"); migrationBuilder.DropColumn( name: "AdditionalScore", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Consumption", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "CorrectJudge", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "CorrectNumber", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Duration", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "ErrorNumber", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "MaxValue", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "MinValue", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "MotionDuration", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Rank", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "RankStr", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Remark", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Score", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Sex", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Strength", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "StudentName", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "StudentNo", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "UniqueId", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "Value", table: "Ai_TrainingData"); migrationBuilder.DropColumn( name: "WrongResults", table: "Ai_TrainingData"); migrationBuilder.AddColumn( name: "StudentCount", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "班级人数"); migrationBuilder.AddColumn( name: "TotalNumber", table: "Ai_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "参与人数"); migrationBuilder.CreateTable( name: "Ai_Result", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), ClassId = table.Column(type: "int", nullable: false, comment: "班级Id"), ClassName = table.Column(type: "nvarchar(100)", nullable: true, comment: "班级名称"), Code = table.Column(type: "nvarchar(100)", nullable: true, comment: "AI设备的唯一编码"), CorrectJudge = table.Column(type: "nvarchar(4000)", nullable: true, comment: "动作解析"), Duration = table.Column(type: "int", nullable: false, comment: "持续时间"), Gender = table.Column(type: "int", nullable: false, comment: "性别"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), GradeName = table.Column(type: "nvarchar(100)", nullable: true, comment: "年级名称"), Height = table.Column(type: "float", nullable: true, comment: "身高"), ItemCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "测试项目编码"), Remark = table.Column(type: "nvarchar(4000)", nullable: true, comment: "设备评价语"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校Code"), SchoolName = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校名称"), StudentName = table.Column(type: "nvarchar(1000)", nullable: true, comment: "学生姓名"), StudentNo = table.Column(type: "nvarchar(1000)", nullable: true, comment: "测试的学生全国学籍号"), TeacherId = table.Column(type: "int", nullable: true, comment: "老师Id"), TeacherName = table.Column(type: "nvarchar(100)", nullable: true, comment: "老师姓名"), TestResult = table.Column(type: "float", nullable: false, comment: "成绩"), TestTime = table.Column(type: "datetime", nullable: true, comment: "学生实际测试结束的时间"), UniqueId = table.Column(type: "bigint", nullable: false, comment: "设备上传成绩时唯一标识, 重复时服务端不保存数据"), Weight = table.Column(type: "float", nullable: true, comment: "体重"), WrongResults = table.Column(type: "float", nullable: true, comment: "错误成绩") }, constraints: table => { table.PrimaryKey("PK_Ai_Result", 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"), TrainingDataId = table.Column(type: "int", nullable: false, comment: "训练数据Id"), AdditionalScore = table.Column(type: "float", nullable: false, comment: "附加分"), Consumption = table.Column(type: "int", nullable: false, comment: "运动消耗"), CorrectNumber = table.Column(type: "int", nullable: true, comment: "正确个数"), ErrorNumber = table.Column(type: "int", nullable: true, comment: "错误个数"), EvaluationGrade = table.Column(type: "int", nullable: false, comment: "测评等级"), MaxValue = table.Column(type: "int", nullable: true, comment: "最大"), MinValue = table.Column(type: "int", nullable: true, comment: "最小"), MotionDuration = table.Column(type: "int", nullable: false, comment: "运动时长/分钟"), Rank = table.Column(type: "int", nullable: false, comment: "训练成绩等级"), RankStr = table.Column(type: "nvarchar(100)", nullable: true, comment: "等级"), Score = table.Column(type: "float", nullable: false, comment: "得分"), Sex = table.Column(type: "int", nullable: false, comment: "学校Co性别de"), Strength = table.Column(type: "int", nullable: false, comment: "运动强度"), StudentName = table.Column(type: "nvarchar(100)", nullable: true, comment: "姓名"), StudentNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学号"), Value = table.Column(type: "float", nullable: false, comment: "测试成绩") }, 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", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Ai_TrainingDetailsData_TrainingDataId", table: "Ai_TrainingDetailsData", column: "TrainingDataId"); } } }