using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace VOL.Core.Migrations { public partial class init027 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "Value", table: "N_SportsTestValue", type: "float", nullable: false, comment: "测试结果", oldClrType: typeof(double), oldType: "double", oldComment: "测试结果"); migrationBuilder.AlterColumn( name: "InsertTime", table: "I_TrainingData", type: "datetime", nullable: true, comment: "开始时间", oldClrType: typeof(string), oldType: "nvarchar(100)", oldNullable: true, oldComment: "开始时间"); migrationBuilder.AlterColumn( name: "EndTime", table: "I_TrainingData", type: "datetime", nullable: true, comment: "结束时间", oldClrType: typeof(string), oldType: "nvarchar(100)", oldNullable: true, oldComment: "结束时间"); migrationBuilder.AddColumn( name: "AvgEff", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "握力效率平均值"); migrationBuilder.AddColumn( name: "AvgNumMan", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "男生平均"); migrationBuilder.AddColumn( name: "AvgNumWom", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "女生平均"); migrationBuilder.AddColumn( name: "ClassAvgKcal", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "平均kcal (协调项目:所有学生总个数)"); migrationBuilder.AddColumn( name: "ClassAvgTime", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "时间平均数"); migrationBuilder.AddColumn( name: "ClassDate", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "开始日期"); migrationBuilder.AddColumn( name: "ClassHightPer", table: "I_TrainingData", type: "int", nullable: true, comment: "优秀人数 (心率的达标人数)"); migrationBuilder.AddColumn( name: "ClassLowNum", table: "I_TrainingData", type: "int", nullable: true, comment: "合格"); migrationBuilder.AddColumn( name: "ClassMaxNum", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "最大圈数"); migrationBuilder.AddColumn( name: "ClassMedian", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "中位数"); migrationBuilder.AddColumn( name: "ClassMinNum", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "最小圈数"); migrationBuilder.AddColumn( name: "ClassName", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "班级名称"); migrationBuilder.AddColumn( name: "ClassNum", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "班级人数"); migrationBuilder.AddColumn( name: "ClassNumAvg", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "平均数"); migrationBuilder.AddColumn( name: "ClassTime", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "开始时间"); migrationBuilder.AddColumn( name: "ClassTimeMedian", table: "I_TrainingData", type: "int", nullable: true, comment: "时间中位数"); migrationBuilder.AddColumn( name: "ClassTotal", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "总个数 (协调项目:所有学生总个数)"); migrationBuilder.AddColumn( name: "ClassWellNum", table: "I_TrainingData", type: "int", nullable: true, comment: "良好"); migrationBuilder.AddColumn( name: "Distance", table: "I_TrainingData", type: "int", nullable: true, comment: "自由模式 设置跑步距离"); migrationBuilder.AddColumn( name: "DistanceUseTime", table: "I_TrainingData", type: "real", nullable: true, comment: "自由模式设置 距离所需时间 (算合格)"); migrationBuilder.AddColumn( name: "GradeName", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "年级名称"); migrationBuilder.AddColumn( name: "KoTimeR", table: "I_TrainingData", type: "nvarchar(max)", nullable: true, comment: "握力红队KO时间"); migrationBuilder.AddColumn( name: "KoTimeY", table: "I_TrainingData", type: "nvarchar(max)", nullable: true, comment: "握力黄队KO时间"); migrationBuilder.AddColumn( name: "Level1", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低1"); migrationBuilder.AddColumn( name: "Level10", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低10"); migrationBuilder.AddColumn( name: "Level2", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低2"); migrationBuilder.AddColumn( name: "Level3", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低3"); migrationBuilder.AddColumn( name: "Level4", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低4"); migrationBuilder.AddColumn( name: "Level5", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低5"); migrationBuilder.AddColumn( name: "Level6", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低6"); migrationBuilder.AddColumn( name: "Level7", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低7"); migrationBuilder.AddColumn( name: "Level8", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低8"); migrationBuilder.AddColumn( name: "Level9", table: "I_TrainingData", type: "int", nullable: false, defaultValue: 0, comment: "跳绳等级高低9"); migrationBuilder.AddColumn( name: "MaxEff", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "握力效率大值"); migrationBuilder.AddColumn( name: "MaxNumMan", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "男生最大值"); migrationBuilder.AddColumn( name: "MaxNumWom", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "女生最大值"); migrationBuilder.AddColumn( name: "MaxUseTime", table: "I_TrainingData", type: "int", nullable: true, comment: "限时限数班级中最大用时"); migrationBuilder.AddColumn( name: "MedianNumMan", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "男生中位数"); migrationBuilder.AddColumn( name: "MedianNumWom", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "女生中位数"); migrationBuilder.AddColumn( name: "MinEff", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "握力效率最小值"); migrationBuilder.AddColumn( name: "MinNumMan", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "男生最小值"); migrationBuilder.AddColumn( name: "MinNumWom", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "女生最小值"); migrationBuilder.AddColumn( name: "MinUseTime", table: "I_TrainingData", type: "int", nullable: true, comment: "限时限数班级中最小用时"); migrationBuilder.AddColumn( name: "ModelType", table: "I_TrainingData", type: "int", nullable: true, comment: "当前模式类型 (1: 倒计时,2: 正向计数,3: 限时限数)"); migrationBuilder.AddColumn( name: "Speed", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "速度 (个/s)"); migrationBuilder.AddColumn( name: "StuName", table: "I_TrainingData", type: "nvarchar(100)", nullable: true, comment: "学生名称"); migrationBuilder.AddColumn( name: "TotalR", table: "I_TrainingData", type: "nvarchar(max)", nullable: true, comment: "握力红队总握力"); migrationBuilder.AddColumn( name: "TotalRound", table: "I_TrainingData", type: "int", nullable: true, comment: "总轮次"); migrationBuilder.AddColumn( name: "TotalTime", table: "I_TrainingData", type: "int", nullable: true, comment: "限时限数总耗时"); migrationBuilder.AddColumn( name: "TotalY", table: "I_TrainingData", type: "nvarchar(max)", nullable: true, comment: "握力黄队总握力"); migrationBuilder.AddColumn( name: "TrainTimer", table: "I_TrainingData", type: "int", nullable: true, comment: "正向计数总共使用时间 (秒)"); migrationBuilder.AddColumn( name: "TrainingTime", table: "I_TrainingData", type: "int", nullable: true, comment: "训练倒计时时间 (1, 2 分钟)"); migrationBuilder.AlterColumn( name: "WrongResults", table: "Ai_Result", type: "real", nullable: false, defaultValue: 0f, oldClrType: typeof(float), oldType: "real", oldNullable: true); migrationBuilder.AlterColumn( name: "TestResult", table: "Ai_Result", type: "real", nullable: false, defaultValue: 0f, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.CreateTable( name: "I_TrainGroup", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), GroupName = table.Column(type: "nvarchar(100)", nullable: true, comment: "组名"), DevicesName = table.Column(type: "nvarchar(100)", nullable: true, comment: "设备名称"), GroupTotalNum = table.Column(type: "int", nullable: false, comment: "总数"), GroupAvg = table.Column(type: "nvarchar(100)", nullable: true, comment: "平均"), GroupMedianNum = table.Column(type: "int", nullable: false, comment: "中位数"), GroupMax = table.Column(type: "int", nullable: false, comment: "最大"), GroupMin = table.Column(type: "int", nullable: false, comment: "最小"), GroupAvgKcal = table.Column(type: "nvarchar(100)", nullable: true, comment: "平均卡路里"), GroupSpeed = table.Column(type: "nvarchar(100)", nullable: true, comment: "每秒个数"), GroupHigh = table.Column(type: "int", nullable: false, comment: "优秀"), GroupM = table.Column(type: "int", nullable: false, comment: "良好"), GroupLow = table.Column(type: "int", nullable: false, comment: "合格"), GroupUseTime = table.Column(type: "int", nullable: false, comment: "限时限数完成总时间 / 红黄捏捏蛋对决 KO 时间"), GroupAvgTime = table.Column(type: "float", nullable: false, comment: "时间平均数"), GroupTimeMedian = table.Column(type: "int", nullable: false, comment: "时间中位数"), SecondsNumber = table.Column(type: "real", nullable: false, comment: "平均速度"), StuName = table.Column(type: "nvarchar(100)", nullable: true, comment: "学生名称 (在随堂测试有效)"), IsGroup = table.Column(type: "bit", nullable: false, comment: "true A组, false B组"), MinUseTime = table.Column(type: "int", nullable: false, comment: "限时限数班级中最小用时"), MaxUseTime = table.Column(type: "int", nullable: false, comment: "限时限数班级中最大用时"), Level1 = table.Column(type: "int", nullable: false, comment: "等级高低1"), Level2 = table.Column(type: "int", nullable: false, comment: "等级高低2"), Level3 = table.Column(type: "int", nullable: false, comment: "等级高低3"), Level4 = table.Column(type: "int", nullable: false, comment: "等级高低4"), Level5 = table.Column(type: "int", nullable: false, comment: "等级高低5"), Level6 = table.Column(type: "int", nullable: false, comment: "等级高低6"), Level7 = table.Column(type: "int", nullable: false, comment: "等级高低7"), Level8 = table.Column(type: "int", nullable: false, comment: "等级高低8"), Level9 = table.Column(type: "int", nullable: false, comment: "等级高低9"), Level10 = table.Column(type: "int", nullable: false, comment: "等级高低10"), GroupSpeedCompleteNum = table.Column(type: "int", nullable: false, comment: "自由训练距离完成人数"), GroupSpeedCompletePre = table.Column(type: "int", nullable: false, comment: "百分比"), GroupSpeedTotalTime = table.Column(type: "real", nullable: false, comment: "自由训练总时间"), GroupSpeedAvgTime = table.Column(type: "real", nullable: false, comment: "自由训练平均时间"), GroupSpeedMedianTime = table.Column(type: "real", nullable: false, comment: "自由训练中位数时间"), GroupSpeedMinTime = table.Column(type: "real", nullable: false, comment: "自由训练最小时间"), GroupSpeedMaxime = table.Column(type: "real", nullable: false, comment: "自由训练最大时间"), MaxEff = table.Column(type: "nvarchar(100)", nullable: true, comment: "握力效率最大值"), MinEff = table.Column(type: "nvarchar(100)", nullable: true, comment: "握力效率最小值"), AvgEff = table.Column(type: "nvarchar(100)", nullable: true, comment: "握力效率平均值"), TrainingDataId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_TrainGroup", x => x.Id); table.ForeignKey( name: "FK_I_TrainGroup_I_TrainingData_TrainingDataId", column: x => x.TrainingDataId, principalTable: "I_TrainingData", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "I_TrainRanking", 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"), 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: "班级名称"), StudentNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学号"), Ranking = table.Column(type: "int", nullable: true, comment: "名次"), LongRunNum = table.Column(type: "nvarchar(2000)", nullable: true, comment: "长跑次数数组"), GroupName = table.Column(type: "nvarchar(200)", nullable: true, comment: "组名"), StudentName = table.Column(type: "nvarchar(100)", nullable: true, comment: "姓名"), Gender = table.Column(type: "int", nullable: false, comment: "学校Co性别de"), SecondsNumber = table.Column(type: "float", nullable: true, comment: "每秒"), SpeedTime = table.Column(type: "float", nullable: true, comment: "数值"), Kcal = table.Column(type: "nvarchar(100)", nullable: true, comment: "能耗"), Efficiency = table.Column(type: "float", nullable: true, comment: "握力"), PowerTotal = table.Column(type: "float", nullable: true, comment: "每个人总的握力"), PowerMax = table.Column(type: "float", nullable: true, comment: "每个人最大握力"), BalanceMaxNumber = table.Column(type: "int", nullable: true, comment: "平衡最大值"), DevicesName = table.Column(type: "nvarchar(100)", nullable: true, comment: "设备名称"), UseTime = table.Column(type: "int", nullable: false, comment: "使用时间,限时限数最短"), isGroup = table.Column(type: "bit", nullable: false, comment: "队伍:黄队 = true, 红队 = false"), StudentRound = table.Column(type: "int", nullable: true, comment: "第几轮"), TrainType = table.Column(type: "int", nullable: false, comment: "训练类型"), ModeType = table.Column(type: "int", nullable: false, comment: "倒计时限时限数"), Is_Promoted = table.Column(type: "int", nullable: false, comment: "是否晋级 (0 = 否)"), ResultLevel = table.Column(type: "int", nullable: true, comment: "训练成绩"), JumpValue = table.Column(type: "int", nullable: true, comment: "个数"), ErrorNumber = table.Column(type: "int", nullable: true, comment: "错误个数"), StuAgileSpeedTimeNumber = table.Column(type: "int", nullable: true, comment: "正确个数"), GradeNumer = table.Column(type: "int", nullable: true, comment: "年级总人数"), GradeStandardNumer = table.Column(type: "int", nullable: true, comment: "年级达标次数"), HeartRatePercentage = table.Column(type: "int", nullable: true, comment: "心率强度百分比"), HighHeartRate = table.Column(type: "int", nullable: true, comment: "最高心率"), LowHeartRate = table.Column(type: "int", nullable: true, comment: "最低心率"), TrainingDataId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_TrainRanking", x => x.Id); table.ForeignKey( name: "FK_I_TrainRanking_I_TrainingData_TrainingDataId", column: x => x.TrainingDataId, principalTable: "I_TrainingData", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "I_StuDetailInfoEntity", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), GroupRanking = table.Column(type: "int", nullable: false, comment: "组排名"), GroupNumber = table.Column(type: "nvarchar(100)", nullable: true, comment: "组编号"), TotalNumber = table.Column(type: "int", nullable: false, comment: "总数"), SpeedTime = table.Column(type: "float", nullable: false, comment: "速度时间"), Speed = table.Column(type: "float", nullable: false, comment: "速度"), Kcal = table.Column(type: "nvarchar(100)", nullable: true, comment: "卡路里"), ClassRanking = table.Column(type: "int", nullable: false, comment: "班级排名"), Level = table.Column(type: "int", nullable: false, comment: "等级"), UseTime = table.Column(type: "int", nullable: false, comment: "使用时间"), IsGroup = table.Column(type: "bit", nullable: false, comment: "是否是组"), PowerMax = table.Column(type: "float", nullable: false, comment: "最大握力"), PowerTotal = table.Column(type: "float", nullable: false, comment: "总握力"), Efficiency = table.Column(type: "float", nullable: false, comment: "效率"), TrainGroupId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_StuDetailInfoEntity", x => x.Id); table.ForeignKey( name: "FK_I_StuDetailInfoEntity_I_TrainGroup_TrainGroupId", column: x => x.TrainGroupId, principalTable: "I_TrainGroup", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_I_StuDetailInfoEntity_TrainGroupId", table: "I_StuDetailInfoEntity", column: "TrainGroupId"); migrationBuilder.CreateIndex( name: "IX_I_TrainGroup_TrainingDataId", table: "I_TrainGroup", column: "TrainingDataId"); migrationBuilder.CreateIndex( name: "IX_I_TrainRanking_TrainingDataId", table: "I_TrainRanking", column: "TrainingDataId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "WrongResults", table: "Ai_Result", type: "real", nullable: true, oldClrType: typeof(float), oldType: "real", oldDefaultValue: 0f); } } }