using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace YD_YiLu.Api.Migrations { public partial class _20260402v1 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "N_HealthStandards", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), Sex = table.Column(type: "int", nullable: false, comment: "性别"), CategoryEnum = table.Column(type: "nvarchar(100)", nullable: false, comment: "类别名称"), Rank = table.Column(type: "nvarchar(100)", nullable: false, comment: "等级"), Score = table.Column(type: "float", nullable: false, comment: "得分"), MinValue = table.Column(type: "float", nullable: false, comment: "标准值(小)"), MaxValue = table.Column(type: "float", nullable: false, comment: "标准值(大)"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_N_HealthStandards", x => x.Id); }); migrationBuilder.CreateTable( name: "N_SportsTestCategory", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), CategoryName = table.Column(type: "nvarchar(100)", nullable: false, comment: "类别名称"), CategoryEnum = table.Column(type: "nvarchar(100)", nullable: false, comment: "类别名称"), StatisticType = table.Column(type: "int", nullable: false, comment: "统计类型"), IsRopeSkip = table.Column(type: "int", nullable: false, comment: "是否是跳绳"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_N_SportsTestCategory", x => x.Id); }); migrationBuilder.CreateTable( name: "N_SportsTestValue", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校编号"), TeacherId = table.Column(type: "int", nullable: false, comment: "老师Id"), TeacherName = table.Column(type: "nvarchar(100)", nullable: true, comment: "老师名称"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), GradeName = table.Column(type: "nvarchar(100)", nullable: true, comment: "年级名称"), ClassId = table.Column(type: "int", nullable: false, comment: "班级Id"), ClassName = table.Column(type: "nvarchar(100)", nullable: true, comment: "班级名称"), StudentNo = table.Column(type: "nvarchar(100)", nullable: false, comment: "学生学号"), StudentName = table.Column(type: "nvarchar(100)", nullable: false, comment: "学生名称"), Sex = table.Column(type: "int", nullable: false, comment: "性别"), CategoryValue = table.Column(type: "int", nullable: false, comment: "类别枚举值"), CategoryEnum = table.Column(type: "nvarchar(100)", nullable: true, comment: "类别名称"), 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: "附加分"), RankEnum = table.Column(type: "int", nullable: false, comment: "训练成绩等级"), Rank = table.Column(type: "nvarchar(100)", nullable: true, comment: "等级"), ClassRank = table.Column(type: "int", nullable: false, comment: "班级排名"), DataSource = table.Column(type: "int", nullable: false, comment: "数据来源"), WrongResults = table.Column(type: "float", nullable: true, comment: "错误成绩"), ScoreTime = table.Column(type: "datetime", nullable: false, comment: "测试时间"), Height = table.Column(type: "float", nullable: true, comment: "身高"), Weight = table.Column(type: "float", nullable: true, comment: "体重"), Remarks = table.Column(type: "text", nullable: true, comment: "备注"), Year = table.Column(type: "int)", nullable: false, comment: "当前年份"), Semester = table.Column(type: "int)", nullable: false, comment: "学期"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: false, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), IsDisplay = table.Column(type: "bit", nullable: false, comment: "是否显示") }, constraints: table => { table.PrimaryKey("PK_N_SportsTestValue", x => x.Id); }); migrationBuilder.CreateTable( name: "S_Class", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校编号"), GradeId = 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: "班级名称") }, constraints: table => { table.PrimaryKey("PK_S_Class", x => x.Id); }); migrationBuilder.CreateTable( name: "S_Grade", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校编号"), GradeName = table.Column(type: "nvarchar(100)", nullable: false, comment: "年级名称"), Remarks = table.Column(type: "text", nullable: false, comment: "备注"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_S_Grade", x => x.Id); }); migrationBuilder.CreateTable( name: "S_School", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolNatureId = table.Column(type: "int", nullable: false, comment: "学校性质Id"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校编号"), SchoolName = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校名称"), Province = table.Column(type: "nvarchar(20)", nullable: false, comment: "所属省份"), City = table.Column(type: "nvarchar(20)", nullable: false, comment: "所属城市"), Area = table.Column(type: "nvarchar(20)", nullable: false, comment: "所属区域"), Remarks = table.Column(type: "text", nullable: false, comment: "备注"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: false, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_S_School", x => x.Id); }); migrationBuilder.CreateTable( name: "S_SchoolAssocGrade", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校编号"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_S_SchoolAssocGrade", x => x.Id); }); migrationBuilder.CreateTable( name: "S_Student", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: false, comment: "学校编号"), ClassId = table.Column(type: "int", nullable: true, comment: "班级Id"), ClassName = table.Column(type: "nvarchar(100)", nullable: true, comment: "班级名称"), StudentNo = table.Column(type: "nvarchar(100)", nullable: false, comment: "学生学号"), SchoolRollNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学籍号"), PlaceSchoolRollNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "地方学籍号"), HeartRateFrontNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "心率设备正面编号"), HeartRateId = table.Column(type: "nvarchar(100)", nullable: true, comment: "心率设备ID"), HeartRateQRCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "心率设备二维码编号"), RopeSkipQRCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "跳绳编号"), RopeSkipNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "跳绳二维码编号"), RunChipNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "中长跑芯片编号"), TotalTrainTime = table.Column(type: "float", nullable: true, comment: "训练时长"), TotalTrainNumber = table.Column(type: "int", nullable: true, comment: "训练次数"), IDCard = table.Column(type: "nvarchar(50)", nullable: true, comment: "身份证"), StudentNation = table.Column(type: "nvarchar(50)", nullable: true, comment: "学生名族"), StudentName = table.Column(type: "nvarchar(100)", nullable: false, comment: "学生名称"), Age = table.Column(type: "int", nullable: false, comment: "年龄"), Sex = table.Column(type: "int", nullable: false, comment: "性别"), Photo = table.Column(type: "nvarchar(2000)", nullable: true, comment: "学生照片"), Nation = table.Column(type: "nvarchar(20)", nullable: true, comment: "民族"), HomeAddress = table.Column(type: "nvarchar(200)", nullable: true, comment: "家庭住址"), StudentStatus = table.Column(type: "int", nullable: true, comment: "状态"), Birthday = table.Column(type: "datetime", nullable: true, comment: "出生日期"), ParentName = table.Column(type: "nvarchar(20)", nullable: true, comment: "家长姓名"), ParentPhoneNo = table.Column(type: "nvarchar(20)", nullable: true, comment: "家长联系方式"), AppletPwd = table.Column(type: "nvarchar(100)", nullable: true, comment: "小程序密码"), Remarks = table.Column(type: "text", nullable: true, comment: "备注"), Creator = table.Column(type: "int)", nullable: true, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int)", nullable: true, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_S_Student", x => x.Id); }); migrationBuilder.CreateTable( name: "Sys_User", columns: table => new { User_Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Gender = table.Column(type: "int", nullable: false), HeadImageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), Dept_Id = table.Column(type: "int", nullable: true), DeptName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), Role_Id = table.Column(type: "int", nullable: false), RoleName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Token = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), AppType = table.Column(type: "int", nullable: true), UserTrueName = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), SchoolCode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), SchoolName = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), UserPwd = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), CreateDate = table.Column(type: "datetime", nullable: true), PhoneNo = table.Column(type: "nvarchar(11)", maxLength: 11, nullable: false), CreateID = table.Column(type: "int", nullable: true), Creator = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Enable = table.Column(type: "int", nullable: false), ModifyID = table.Column(type: "int", nullable: true), Modifier = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), ModifyDate = table.Column(type: "datetime", nullable: true), AuditDate = table.Column(type: "datetime", nullable: true), LastLoginDate = table.Column(type: "datetime", nullable: true), LastModifyPwdDate = table.Column(type: "datetime", nullable: true), Address = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Remark = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) }, constraints: table => { table.PrimaryKey("PK_Sys_User", x => x.User_Id); }); migrationBuilder.CreateTable( name: "XW_ProjectMode", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), ProjectKind = table.Column(type: "int", nullable: false, comment: "ProjectKind"), Name = table.Column(type: "nvarchar(100)", nullable: false, comment: "名称"), CategoryEnum = table.Column(type: "nvarchar(100)", nullable: false, comment: "枚举") }, constraints: table => { table.PrimaryKey("PK_XW_ProjectMode", x => x.Id); }); migrationBuilder.CreateTable( name: "XW_SportsTestData", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), ExaminationId = table.Column(type: "int", nullable: true, comment: "考试id"), ExaminationName = table.Column(type: "nvarchar(max)", nullable: true, comment: "考试名称"), ProjectType = table.Column(type: "int", nullable: true, comment: "项目类型(1体检 2体质)"), ProjectId = table.Column(type: "int", nullable: true, comment: "项目ID"), ProjectName = table.Column(type: "nvarchar(max)", nullable: false, comment: "项目名称"), RosterType = table.Column(type: "int", nullable: true, comment: "模式类型(1随堂模式2名单模式3刷卡或手动录入)"), OrgId = table.Column(type: "int", nullable: true, comment: "学校ID"), GradeId = table.Column(type: "int", nullable: true, comment: "年级ID"), GradeName = table.Column(type: "nvarchar(max)", nullable: false, comment: "年级名称"), ClassId = table.Column(type: "int", nullable: true, comment: "班级或者名单id(根据roster_type来判断)"), ClassName = table.Column(type: "nvarchar(max)", nullable: false, comment: "班级名称"), GroupId = table.Column(type: "nvarchar(max)", nullable: false, comment: "组别"), TeacherId = table.Column(type: "int", nullable: true, comment: "老师ID"), TeacherName = table.Column(type: "nvarchar(max)", nullable: true, comment: "老师名称"), ModelType = table.Column(type: "int", nullable: true, comment: "训练模式"), MarkType = table.Column(type: "int", nullable: true, comment: "评分标准类型(1国家标准2地方标准3自定义标准)"), ProjectKind = table.Column(type: "int", nullable: true, comment: "项目类型(1跳绳2跑步)"), ProjectRuleId = table.Column(type: "int", nullable: true, comment: "训练标准ID"), ProjectKindName = table.Column(type: "nvarchar(max)", nullable: true, comment: "项目类型名称"), MarkTypeName = table.Column(type: "nvarchar(max)", nullable: true, comment: "评分标准类型名称"), ModelTypeName = table.Column(type: "nvarchar(max)", nullable: true, comment: "项目模式名称"), TrainCount = table.Column(type: "int", nullable: true, comment: "训练人数"), StartTime = table.Column(type: "nvarchar(max)", nullable: false, comment: "开始时间"), EndTime = table.Column(type: "nvarchar(max)", nullable: false, comment: "结束时间"), MaleTotal = table.Column(type: "int", nullable: true, comment: "男生总数"), FemaleTotal = table.Column(type: "int", nullable: true, comment: "女生总数"), MaleCount = table.Column(type: "float", nullable: true, comment: "男生总成绩"), MaleMaxCount = table.Column(type: "int", nullable: true, comment: "男生最大值"), MaleMinCount = table.Column(type: "int", nullable: true, comment: "男生最小值"), FemaleCount = table.Column(type: "float", nullable: true, comment: "女生总成绩"), FemaleMaxCount = table.Column(type: "int", nullable: true, comment: "女生最大值"), FemaleMinCount = table.Column(type: "int", nullable: true, comment: "女生最小值"), MaleScore = table.Column(type: "float", nullable: true, comment: "男生总分数"), MaleMaxScore = table.Column(type: "float", nullable: true, comment: "男生最大分数"), MaleMinScore = table.Column(type: "float", nullable: true, comment: "男生最小分数"), FemaleScore = table.Column(type: "float", nullable: true, comment: "女生总分数"), FemaleMaxScore = table.Column(type: "float", nullable: true, comment: "女生最大分数"), FemaleMinScore = table.Column(type: "float", nullable: true, comment: "女生最小分数"), MaleFine = table.Column(type: "int", nullable: true, comment: "男生优秀人数"), MaleGood = table.Column(type: "int", nullable: true, comment: "男生良好人数"), MalePass = table.Column(type: "int", nullable: true, comment: "男生及格人数"), MaleFail = table.Column(type: "int", nullable: true, comment: "男生不及格人数"), FemaleFine = table.Column(type: "int", nullable: true, comment: "女生优秀人数"), FemaleGood = table.Column(type: "int", nullable: true, comment: "女生良好人数"), FemalePass = table.Column(type: "int", nullable: true, comment: "女生及格人数"), FemaleFail = table.Column(type: "int", nullable: true, comment: "女生不及格人数"), PassingRate = table.Column(type: "float", nullable: true, comment: "及格率"), MaleAvgCount = table.Column(type: "float", nullable: true, comment: "男生平均个数"), FemaleAvgCount = table.Column(type: "float", nullable: true, comment: "女生平均个数"), MaleAvgScore = table.Column(type: "float", nullable: true, comment: "男生平均分数"), FemaleAvgScore = table.Column(type: "float", nullable: true, comment: "女生平均分数"), MaleMedianCount = table.Column(type: "float", nullable: true, comment: "男生中位数"), FemaleMedianCount = table.Column(type: "float", nullable: true, comment: "女生中位数"), MaleAvgImproveCount = table.Column(type: "int", nullable: true, comment: "男生平均值"), MaleMaxImproveCount = table.Column(type: "int", nullable: true, comment: "男生最大值"), MaleMinImproveCount = table.Column(type: "int", nullable: true, comment: "男生最小值"), FemaleAvgImproveCount = table.Column(type: "int", nullable: true, comment: "女生平均值"), FemaleMaxImproveCount = table.Column(type: "int", nullable: true, comment: "女生最大值"), FemaleMinImproveCount = table.Column(type: "int", nullable: true, comment: "女生最小值"), MaleAvgImproveScore = table.Column(type: "float", nullable: true, comment: "男生平均分数"), MaleMaxImproveScore = table.Column(type: "float", nullable: true, comment: "男生最大分数"), MaleMinImproveScore = table.Column(type: "float", nullable: true, comment: "男生最小分数"), FemaleAvgImproveScore = table.Column(type: "float", nullable: true, comment: "女生平均分数"), FemaleMaxImproveScore = table.Column(type: "float", nullable: true, comment: "女生最大分数"), FemaleMinImproveScore = table.Column(type: "float", nullable: true, comment: "女生最小分数"), MinErrorCount = table.Column(type: "int", nullable: true, comment: "失误最少的同学次数"), MinIntoStateTime = table.Column(type: "int", nullable: true, comment: "进入状态最快的同学耗时(心率借用这个字段。班级运动时间)"), MinAvgTime = table.Column(type: "int", nullable: true, comment: "第一名平均耗时"), TotalErrorCount = table.Column(type: "int", nullable: true, comment: "失误总次数"), LossesCount1 = table.Column(type: "int", nullable: true, comment: "失误损失次数"), LossesCount2 = table.Column(type: "int", nullable: true, comment: "甩绳速度偏慢损失次数"), LossesCount3 = table.Column(type: "int", nullable: true, comment: "进入状态过慢损失次数"), CheckCode = table.Column(type: "nvarchar(max)", nullable: false, comment: "提交标识"), CreateTime = table.Column(type: "nvarchar(max)", nullable: true, comment: "创建时间"), CreateBy = table.Column(type: "nvarchar(max)", nullable: true, comment: "创建人"), UpdateTime = table.Column(type: "nvarchar(max)", nullable: true, comment: "修改时间"), UpdateBy = table.Column(type: "nvarchar(max)", nullable: true, comment: "修改人"), DoubleFlag = table.Column(type: "bit", nullable: true, comment: "是否双人模式"), Source = table.Column(type: "int", nullable: true, comment: "数据来源(1:pad, 2:微信小程序)"), StudentName = table.Column(type: "nvarchar(max)", nullable: true, comment: "学生姓名") }, constraints: table => { table.PrimaryKey("PK_XW_SportsTestData", x => x.Id); }); migrationBuilder.CreateTable( name: "XW_TestingProject", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), OrgId = table.Column(type: "int", nullable: false, comment: "OrgId"), ProjectId = table.Column(type: "int", nullable: false, comment: "ProjectId"), ProjectName = table.Column(type: "nvarchar(100)", nullable: false, comment: "名称"), CategoryEnum = table.Column(type: "nvarchar(100)", nullable: false, comment: "枚举"), CategoryValue = table.Column(type: "int", nullable: false, comment: "枚举"), IsOpen = table.Column(type: "bit", nullable: false, comment: "IsOpen"), IsShow = table.Column(type: "bit", nullable: false, comment: "IsShow") }, constraints: table => { table.PrimaryKey("PK_XW_TestingProject", x => x.Id); }); migrationBuilder.CreateTable( name: "YL_Device", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SportStationId = table.Column(type: "bigint", nullable: false), OrgId = table.Column(type: "int", nullable: true), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), TenantName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), SerialNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), AndroidId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), IMEI = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), IMSI = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), IsCalibration = table.Column(type: "int", nullable: false), IsSynchronization = table.Column(type: "int", nullable: false), IsActive = table.Column(type: "int", nullable: false), IsOnline = table.Column(type: "int", nullable: false), LastOnlineTime = table.Column(type: "datetime2", nullable: true), CreateTime = table.Column(type: "datetime2", nullable: false), UpdateTime = table.Column(type: "datetime2", nullable: true), Remark = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false) }, constraints: table => { table.PrimaryKey("PK_YL_Device", x => x.Id); }); migrationBuilder.CreateTable( name: "XW_TrainSetting", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), TrainId = table.Column(type: "int", nullable: true, comment: "训练ID"), CircleCount = table.Column(type: "int", nullable: true, comment: "圈数"), CircleInterval = table.Column(type: "int", nullable: true, comment: "每圈时间间隔"), FirstCircleWhole = table.Column(type: "decimal(18,2)", nullable: true, comment: "首圈是否整圈(1-不完整,2-完整)"), FirstCircleInterval = table.Column(type: "int", nullable: true, comment: "首圈时间间隔"), DecimalPlace = table.Column(type: "decimal(18,2)", nullable: true, comment: "保留秒以下的小数位数"), CircleCountGirl = table.Column(type: "int", nullable: true, comment: "女生圈数"), CircleIntervalGirl = table.Column(type: "int", nullable: true, comment: "女生每圈时间间隔"), FirstCircleWholeGirl = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生首圈是否整圈(1-不完整,2-完整)"), FirstCircleIntervalGirl = table.Column(type: "int", nullable: true, comment: "女生首圈时间间隔"), CreateTime = table.Column(type: "nvarchar(max)", nullable: false, comment: "创建时间"), CreateBy = table.Column(type: "nvarchar(max)", nullable: false, comment: "创建人"), XW_SportsTestDataId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_XW_TrainSetting", x => x.Id); table.ForeignKey( name: "FK_XW_TrainSetting_XW_SportsTestData_XW_SportsTestDataId", column: x => x.XW_SportsTestDataId, principalTable: "XW_SportsTestData", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "XW_TrainStudents", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), TrainId = table.Column(type: "int", nullable: true, comment: "训练ID"), ProjectId = table.Column(type: "int", nullable: true, comment: "项目ID"), ProjectKind = table.Column(type: "int", nullable: true, comment: "项目类型(1跳绳2跑步)"), OrgId = table.Column(type: "int", nullable: true, comment: "学校ID"), GradeId = table.Column(type: "int", nullable: false, comment: "年级ID"), GradeName = table.Column(type: "nvarchar(max)", nullable: false, comment: "年级名称"), ClassId = table.Column(type: "int", nullable: false, comment: "班级ID"), ClassName = table.Column(type: "nvarchar(max)", nullable: false, comment: "班级名称"), GroupName = table.Column(type: "nvarchar(max)", nullable: false, comment: "组别"), GroupOrder = table.Column(type: "int", nullable: true, comment: "组号"), TeacherId = table.Column(type: "int", nullable: true, comment: "老师ID"), DeviceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "设备ID"), StudentId = table.Column(type: "int", nullable: false, comment: "学生ID"), StudentName = table.Column(type: "nvarchar(max)", nullable: false, comment: "学生名称"), Sex = table.Column(type: "int", nullable: false, comment: "性别(1男2女)"), StudentNo = table.Column(type: "nvarchar(max)", nullable: false, comment: "学号"), Achievement = table.Column(type: "float", nullable: true, comment: "标准成绩"), OriginalAchievement = table.Column(type: "int", nullable: true, comment: "原始标准成绩(被格式化小数点之前的)"), Achievement2 = table.Column(type: "float", nullable: true, comment: "标准成绩2"), OriginalAchievement2 = table.Column(type: "int", nullable: true, comment: "原始标准成绩2(被格式化小数点之前的)"), Score = table.Column(type: "float", nullable: false, comment: "得分"), PlusesScore = table.Column(type: "float", nullable: true, comment: "加分项得分"), Rating = table.Column(type: "int", nullable: true, comment: "评分等级"), RankingInGender = table.Column(type: "int", nullable: true, comment: "男生或女生排名"), Ranking = table.Column(type: "int", nullable: true, comment: "全体排名"), ErrorCount = table.Column(type: "int", nullable: true, comment: "失误总次数"), ErrorTime = table.Column(type: "int", nullable: true, comment: "失误总耗时"), AvgTime = table.Column(type: "int", nullable: true, comment: "平均耗时"), MedianTime = table.Column(type: "int", nullable: true, comment: "有效平均值(中位数)"), LossesCount1 = table.Column(type: "int", nullable: true, comment: "失误损失次数"), LossesCount2 = table.Column(type: "int", nullable: true, comment: "甩绳速度偏慢损失次数"), LossesCount3 = table.Column(type: "int", nullable: true, comment: "进入状态过慢损失次数"), HigherScore = table.Column(type: "int", nullable: true, comment: "高一档分数段"), IntoStateTime = table.Column(type: "int", nullable: true, comment: "进入状态耗时"), ImproveCount = table.Column(type: "int", nullable: true, comment: "次数提升空间"), ImproveScore = table.Column(type: "float", nullable: true, comment: "分数提升空间"), FamilySendFlag = table.Column(type: "int", nullable: true, comment: "家长消息发送标识"), Completed = table.Column(type: "bit", nullable: true, comment: "是否已经完成"), QuantityCompleted = table.Column(type: "int", nullable: true, comment: "实际完成的数量(圈数)"), ModelType = table.Column(type: "int", nullable: true, comment: "报表显示"), StartTime = table.Column(type: "nvarchar(max)", nullable: true, comment: "开始时间"), Teacher = table.Column(type: "nvarchar(max)", nullable: true, comment: "教师"), Times = table.Column(type: "int", nullable: false), VideoRecord = table.Column(type: "nvarchar(max)", nullable: false), CreateTime = table.Column(type: "nvarchar(max)", nullable: true, comment: "创建时间"), CreateBy = table.Column(type: "nvarchar(max)", nullable: true, comment: "创建人"), UpdateTime = table.Column(type: "nvarchar(max)", nullable: true, comment: "修改时间"), UpdateBy = table.Column(type: "nvarchar(max)", nullable: true, comment: "修改人"), XW_SportsTestDataId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_XW_TrainStudents", x => x.Id); table.ForeignKey( name: "FK_XW_TrainStudents_XW_SportsTestData_XW_SportsTestDataId", column: x => x.XW_SportsTestDataId, principalTable: "XW_SportsTestData", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "XW_TrainViolationsBO", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), ViolationId = table.Column(type: "int", nullable: true, comment: "违规动作编号"), PicUrl = table.Column(type: "nvarchar(max)", nullable: false, comment: "违规动图地址"), SkipStumblingNumber = table.Column(type: "int", nullable: true, comment: "跳绳绊脚次数"), TrainTime = table.Column(type: "nvarchar(max)", nullable: false, comment: "违规动作训练时间"), XW_TrainStudentsId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_XW_TrainViolationsBO", x => x.Id); table.ForeignKey( name: "FK_XW_TrainViolationsBO_XW_TrainStudents_XW_TrainStudentsId", column: x => x.XW_TrainStudentsId, principalTable: "XW_TrainStudents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_XW_TrainSetting_XW_SportsTestDataId", table: "XW_TrainSetting", column: "XW_SportsTestDataId", unique: true); migrationBuilder.CreateIndex( name: "IX_XW_TrainStudents_XW_SportsTestDataId", table: "XW_TrainStudents", column: "XW_SportsTestDataId"); migrationBuilder.CreateIndex( name: "IX_XW_TrainViolationsBO_XW_TrainStudentsId", table: "XW_TrainViolationsBO", column: "XW_TrainStudentsId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "N_HealthStandards"); migrationBuilder.DropTable( name: "N_SportsTestCategory"); migrationBuilder.DropTable( name: "N_SportsTestValue"); migrationBuilder.DropTable( name: "S_Class"); migrationBuilder.DropTable( name: "S_Grade"); migrationBuilder.DropTable( name: "S_School"); migrationBuilder.DropTable( name: "S_SchoolAssocGrade"); migrationBuilder.DropTable( name: "S_Student"); migrationBuilder.DropTable( name: "Sys_User"); migrationBuilder.DropTable( name: "XW_ProjectMode"); migrationBuilder.DropTable( name: "XW_TestingProject"); migrationBuilder.DropTable( name: "XW_TrainSetting"); migrationBuilder.DropTable( name: "XW_TrainViolationsBO"); migrationBuilder.DropTable( name: "YL_Device"); migrationBuilder.DropTable( name: "XW_TrainStudents"); migrationBuilder.DropTable( name: "XW_SportsTestData"); } } }