using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace VOL.Core.Migrations { public partial class _20250115v1 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "XW_Device", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), Type = table.Column(type: "float", nullable: true, comment: "类型"), DeviceType = table.Column(type: "nvarchar(255)", nullable: true, comment: "设备型号"), DeviceSerial = table.Column(type: "nvarchar(255)", nullable: true, comment: "设备序列号"), DeviceMac = table.Column(type: "nvarchar(255)", nullable: true, comment: "设备 MAC 地址"), DeviceImei = table.Column(type: "nvarchar(255)", nullable: true, comment: "设备 IMEI 地址"), CameraIp = table.Column(type: "nvarchar(255)", nullable: true, comment: "AI 摄像机 IP 地址"), GunJumpingIp = table.Column(type: "nvarchar(255)", nullable: true, comment: "抢跑 IP"), Eai100Flag = table.Column(type: "bit", nullable: true, comment: "是否是 EAI100 摄像头"), OrgId = table.Column(type: "int", nullable: true, comment: "组织 ID"), OrgName = table.Column(type: "nvarchar(255)", nullable: true, comment: "组织名称"), UserId = table.Column(type: "int", nullable: true, comment: "用户 ID"), UserName = table.Column(type: "nvarchar(255)", nullable: true, comment: "用户名称"), SoftWareVer = table.Column(type: "nvarchar(255)", nullable: true, comment: "软件版本"), HardwareVer = table.Column(type: "nvarchar(255)", nullable: true, comment: "硬件版本"), DeployTime = table.Column(type: "datetime", nullable: true, comment: "应用时间"), LastLoginTime = table.Column(type: "datetime", nullable: true, comment: "最后登录时间"), Remark = table.Column(type: "nvarchar(255)", nullable: true, comment: "备注"), State = table.Column(type: "int", nullable: true, comment: "授权状态"), Status = table.Column(type: "int", nullable: true, comment: "状态"), CreateTime = table.Column(type: "datetime", nullable: true, comment: "创建时间"), CreateBy = table.Column(type: "nvarchar(255)", nullable: true, comment: "创建人"), UpdateTime = table.Column(type: "datetime", nullable: true, comment: "修改时间"), UpdateBy = table.Column(type: "nvarchar(255)", nullable: true, comment: "修改人"), SimilarNumber = table.Column(type: "int", nullable: true, comment: "学校人脸的相似度") }, constraints: table => { table.PrimaryKey("PK_XW_Device", 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: true, 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: true, comment: "年级名称"), ClassId = table.Column(type: "int", nullable: true, comment: "班级或者名单id(根据roster_type来判断)"), ClassName = table.Column(type: "nvarchar(max)", nullable: true, comment: "班级名称"), GroupId = table.Column(type: "nvarchar(max)", nullable: true, 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: true, comment: "开始时间"), EndTime = table.Column(type: "nvarchar(max)", nullable: true, comment: "结束时间"), MaleTotal = table.Column(type: "int", nullable: true, comment: "男生总数"), FemaleTotal = table.Column(type: "int", nullable: true, comment: "女生总数"), MaleCount = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生总成绩"), MaleMaxCount = table.Column(type: "int", nullable: true, comment: "男生最大值"), MaleMinCount = table.Column(type: "int", nullable: true, comment: "男生最小值"), FemaleCount = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生总成绩"), FemaleMaxCount = table.Column(type: "int", nullable: true, comment: "女生最大值"), FemaleMinCount = table.Column(type: "int", nullable: true, comment: "女生最小值"), MaleScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生总分数"), MaleMaxScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生最大分数"), MaleMinScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生最小分数"), FemaleScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生总分数"), FemaleMaxScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生最大分数"), FemaleMinScore = table.Column(type: "decimal(18,2)", 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: "decimal(18,2)", nullable: true, comment: "及格率"), MaleAvgCount = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生平均个数"), FemaleAvgCount = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生平均个数"), MaleAvgScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生平均分数"), FemaleAvgScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生平均分数"), MaleMedianCount = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生中位数"), FemaleMedianCount = table.Column(type: "decimal(18,2)", 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: "decimal(18,2)", nullable: true, comment: "男生平均分数"), MaleMaxImproveScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生最大分数"), MaleMinImproveScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "男生最小分数"), FemaleAvgImproveScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生平均分数"), FemaleMaxImproveScore = table.Column(type: "decimal(18,2)", nullable: true, comment: "女生最大分数"), FemaleMinImproveScore = table.Column(type: "decimal(18,2)", 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: true, 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_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: true, comment: "创建时间"), CreateBy = table.Column(type: "nvarchar(max)", nullable: true, comment: "创建人"), XW_SportsTestDataId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_XW_TrainSetting", x => x.Id); }); migrationBuilder.CreateTable( name: "XW_CameraInfo", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "编号") .Annotation("SqlServer:Identity", "1, 1"), SerialNumber = table.Column(type: "nvarchar(max)", nullable: true, comment: "摄像头序列号"), Version = table.Column(type: "nvarchar(max)", nullable: true, comment: "摄像头版本信息"), XW_DeviceId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_XW_CameraInfo", x => x.Id); table.ForeignKey( name: "FK_XW_CameraInfo_XW_Device_XW_DeviceId", column: x => x.XW_DeviceId, principalTable: "XW_Device", 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: "float", nullable: true, comment: "项目类型(1跳绳2跑步)"), 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: true, comment: "年级名称"), ClassId = table.Column(type: "int", nullable: true, comment: "班级ID"), ClassName = table.Column(type: "nvarchar(max)", nullable: true, comment: "班级名称"), GroupName = table.Column(type: "nvarchar(max)", nullable: true, 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: true, comment: "学生ID"), StudentName = table.Column(type: "nvarchar(max)", nullable: true, comment: "学生名称"), Sex = table.Column(type: "float", nullable: true, comment: "性别(1男2女)"), StudentNo = table.Column(type: "nvarchar(max)", nullable: true, comment: "学号"), Achievement = table.Column(type: "int", nullable: true, comment: "标准成绩"), OriginalAchievement = table.Column(type: "int", nullable: true, comment: "原始标准成绩(被格式化小数点之前的)"), Achievement2 = table.Column(type: "int", nullable: true, comment: "标准成绩2"), OriginalAchievement2 = table.Column(type: "int", nullable: true, comment: "原始标准成绩2(被格式化小数点之前的)"), Score = table.Column(type: "float", nullable: true, 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: "教师"), 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: true) }, 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"); }); migrationBuilder.CreateIndex( name: "IX_XW_CameraInfo_XW_DeviceId", table: "XW_CameraInfo", column: "XW_DeviceId"); migrationBuilder.CreateIndex( name: "IX_XW_TrainStudents_XW_SportsTestDataId", table: "XW_TrainStudents", column: "XW_SportsTestDataId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "XW_CameraInfo"); migrationBuilder.DropTable( name: "XW_TrainSetting"); migrationBuilder.DropTable( name: "XW_TrainStudents"); migrationBuilder.DropTable( name: "XW_Device"); migrationBuilder.DropTable( name: "XW_SportsTestData"); } } }