281 lines
23 KiB
C#
281 lines
23 KiB
C#
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<int>(type: "int", nullable: false, comment: "编号")
|
||
.Annotation("SqlServer:Identity", "1, 1"),
|
||
Type = table.Column<float>(type: "float", nullable: true, comment: "类型"),
|
||
DeviceType = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "设备型号"),
|
||
DeviceSerial = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "设备序列号"),
|
||
DeviceMac = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "设备 MAC 地址"),
|
||
DeviceImei = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "设备 IMEI 地址"),
|
||
CameraIp = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "AI 摄像机 IP 地址"),
|
||
GunJumpingIp = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "抢跑 IP"),
|
||
Eai100Flag = table.Column<bool>(type: "bit", nullable: true, comment: "是否是 EAI100 摄像头"),
|
||
OrgId = table.Column<int>(type: "int", nullable: true, comment: "组织 ID"),
|
||
OrgName = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "组织名称"),
|
||
UserId = table.Column<int>(type: "int", nullable: true, comment: "用户 ID"),
|
||
UserName = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "用户名称"),
|
||
SoftWareVer = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "软件版本"),
|
||
HardwareVer = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "硬件版本"),
|
||
DeployTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "应用时间"),
|
||
LastLoginTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最后登录时间"),
|
||
Remark = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "备注"),
|
||
State = table.Column<int>(type: "int", nullable: true, comment: "授权状态"),
|
||
Status = table.Column<int>(type: "int", nullable: true, comment: "状态"),
|
||
CreateTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
|
||
CreateBy = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "创建人"),
|
||
UpdateTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
|
||
UpdateBy = table.Column<string>(type: "nvarchar(255)", nullable: true, comment: "修改人"),
|
||
SimilarNumber = table.Column<int>(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<int>(type: "int", nullable: false, comment: "Id")
|
||
.Annotation("SqlServer:Identity", "1, 1"),
|
||
ExaminationId = table.Column<int>(type: "int", nullable: true, comment: "考试id"),
|
||
ExaminationName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "考试名称"),
|
||
ProjectType = table.Column<int>(type: "int", nullable: true, comment: "项目类型(1体检 2体质)"),
|
||
ProjectId = table.Column<int>(type: "int", nullable: true, comment: "项目ID"),
|
||
ProjectName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "项目名称"),
|
||
RosterType = table.Column<int>(type: "int", nullable: true, comment: "模式类型(1随堂模式2名单模式3刷卡或手动录入)"),
|
||
OrgId = table.Column<int>(type: "int", nullable: true, comment: "学校ID"),
|
||
GradeId = table.Column<int>(type: "int", nullable: true, comment: "年级ID"),
|
||
GradeName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "年级名称"),
|
||
ClassId = table.Column<int>(type: "int", nullable: true, comment: "班级或者名单id(根据roster_type来判断)"),
|
||
ClassName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "班级名称"),
|
||
GroupId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "组别"),
|
||
TeacherId = table.Column<int>(type: "int", nullable: true, comment: "老师ID"),
|
||
TeacherName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老师名称"),
|
||
ModelType = table.Column<int>(type: "int", nullable: true, comment: "训练模式"),
|
||
MarkType = table.Column<int>(type: "int", nullable: true, comment: "评分标准类型(1国家标准2地方标准3自定义标准)"),
|
||
ProjectKind = table.Column<int>(type: "int", nullable: true, comment: "项目类型(1跳绳2跑步)"),
|
||
ProjectRuleId = table.Column<int>(type: "int", nullable: true, comment: "训练标准ID"),
|
||
ProjectKindName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "项目类型名称"),
|
||
MarkTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "评分标准类型名称"),
|
||
ModelTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "项目模式名称"),
|
||
TrainCount = table.Column<int>(type: "int", nullable: true, comment: "训练人数"),
|
||
StartTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "开始时间"),
|
||
EndTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "结束时间"),
|
||
MaleTotal = table.Column<int>(type: "int", nullable: true, comment: "男生总数"),
|
||
FemaleTotal = table.Column<int>(type: "int", nullable: true, comment: "女生总数"),
|
||
MaleCount = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生总成绩"),
|
||
MaleMaxCount = table.Column<int>(type: "int", nullable: true, comment: "男生最大值"),
|
||
MaleMinCount = table.Column<int>(type: "int", nullable: true, comment: "男生最小值"),
|
||
FemaleCount = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生总成绩"),
|
||
FemaleMaxCount = table.Column<int>(type: "int", nullable: true, comment: "女生最大值"),
|
||
FemaleMinCount = table.Column<int>(type: "int", nullable: true, comment: "女生最小值"),
|
||
MaleScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生总分数"),
|
||
MaleMaxScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生最大分数"),
|
||
MaleMinScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生最小分数"),
|
||
FemaleScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生总分数"),
|
||
FemaleMaxScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生最大分数"),
|
||
FemaleMinScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生最小分数"),
|
||
MaleFine = table.Column<int>(type: "int", nullable: true, comment: "男生优秀人数"),
|
||
MaleGood = table.Column<int>(type: "int", nullable: true, comment: "男生良好人数"),
|
||
MalePass = table.Column<int>(type: "int", nullable: true, comment: "男生及格人数"),
|
||
MaleFail = table.Column<int>(type: "int", nullable: true, comment: "男生不及格人数"),
|
||
FemaleFine = table.Column<int>(type: "int", nullable: true, comment: "女生优秀人数"),
|
||
FemaleGood = table.Column<int>(type: "int", nullable: true, comment: "女生良好人数"),
|
||
FemalePass = table.Column<int>(type: "int", nullable: true, comment: "女生及格人数"),
|
||
FemaleFail = table.Column<int>(type: "int", nullable: true, comment: "女生不及格人数"),
|
||
PassingRate = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "及格率"),
|
||
MaleAvgCount = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生平均个数"),
|
||
FemaleAvgCount = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生平均个数"),
|
||
MaleAvgScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生平均分数"),
|
||
FemaleAvgScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生平均分数"),
|
||
MaleMedianCount = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生中位数"),
|
||
FemaleMedianCount = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生中位数"),
|
||
MaleAvgImproveCount = table.Column<int>(type: "int", nullable: true, comment: "男生平均值"),
|
||
MaleMaxImproveCount = table.Column<int>(type: "int", nullable: true, comment: "男生最大值"),
|
||
MaleMinImproveCount = table.Column<int>(type: "int", nullable: true, comment: "男生最小值"),
|
||
FemaleAvgImproveCount = table.Column<int>(type: "int", nullable: true, comment: "女生平均值"),
|
||
FemaleMaxImproveCount = table.Column<int>(type: "int", nullable: true, comment: "女生最大值"),
|
||
FemaleMinImproveCount = table.Column<int>(type: "int", nullable: true, comment: "女生最小值"),
|
||
MaleAvgImproveScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生平均分数"),
|
||
MaleMaxImproveScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生最大分数"),
|
||
MaleMinImproveScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "男生最小分数"),
|
||
FemaleAvgImproveScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生平均分数"),
|
||
FemaleMaxImproveScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生最大分数"),
|
||
FemaleMinImproveScore = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生最小分数"),
|
||
MinErrorCount = table.Column<int>(type: "int", nullable: true, comment: "失误最少的同学次数"),
|
||
MinIntoStateTime = table.Column<int>(type: "int", nullable: true, comment: "进入状态最快的同学耗时(心率借用这个字段。班级运动时间)"),
|
||
MinAvgTime = table.Column<int>(type: "int", nullable: true, comment: "第一名平均耗时"),
|
||
TotalErrorCount = table.Column<int>(type: "int", nullable: true, comment: "失误总次数"),
|
||
LossesCount1 = table.Column<int>(type: "int", nullable: true, comment: "失误损失次数"),
|
||
LossesCount2 = table.Column<int>(type: "int", nullable: true, comment: "甩绳速度偏慢损失次数"),
|
||
LossesCount3 = table.Column<int>(type: "int", nullable: true, comment: "进入状态过慢损失次数"),
|
||
CheckCode = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "提交标识"),
|
||
CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建时间"),
|
||
CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建人"),
|
||
UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "修改时间"),
|
||
UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "修改人"),
|
||
DoubleFlag = table.Column<bool>(type: "bit", nullable: true, comment: "是否双人模式"),
|
||
Source = table.Column<int>(type: "int", nullable: true, comment: "数据来源(1:pad, 2:微信小程序)"),
|
||
StudentName = table.Column<string>(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<int>(type: "int", nullable: false, comment: "Id")
|
||
.Annotation("SqlServer:Identity", "1, 1"),
|
||
TrainId = table.Column<int>(type: "int", nullable: true, comment: "训练ID"),
|
||
CircleCount = table.Column<int>(type: "int", nullable: true, comment: "圈数"),
|
||
CircleInterval = table.Column<int>(type: "int", nullable: true, comment: "每圈时间间隔"),
|
||
FirstCircleWhole = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "首圈是否整圈(1-不完整,2-完整)"),
|
||
FirstCircleInterval = table.Column<int>(type: "int", nullable: true, comment: "首圈时间间隔"),
|
||
DecimalPlace = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "保留秒以下的小数位数"),
|
||
CircleCountGirl = table.Column<int>(type: "int", nullable: true, comment: "女生圈数"),
|
||
CircleIntervalGirl = table.Column<int>(type: "int", nullable: true, comment: "女生每圈时间间隔"),
|
||
FirstCircleWholeGirl = table.Column<decimal>(type: "decimal(18,2)", nullable: true, comment: "女生首圈是否整圈(1-不完整,2-完整)"),
|
||
FirstCircleIntervalGirl = table.Column<int>(type: "int", nullable: true, comment: "女生首圈时间间隔"),
|
||
CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建时间"),
|
||
CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建人"),
|
||
XW_SportsTestDataId = table.Column<int>(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<int>(type: "int", nullable: false, comment: "编号")
|
||
.Annotation("SqlServer:Identity", "1, 1"),
|
||
SerialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "摄像头序列号"),
|
||
Version = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "摄像头版本信息"),
|
||
XW_DeviceId = table.Column<int>(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<int>(type: "int", nullable: false, comment: "Id")
|
||
.Annotation("SqlServer:Identity", "1, 1"),
|
||
TrainId = table.Column<int>(type: "int", nullable: true, comment: "训练ID"),
|
||
ProjectId = table.Column<int>(type: "int", nullable: true, comment: "项目ID"),
|
||
ProjectKind = table.Column<double>(type: "float", nullable: true, comment: "项目类型(1跳绳2跑步)"),
|
||
OrgId = table.Column<int>(type: "int", nullable: true, comment: "学校ID"),
|
||
GradeId = table.Column<int>(type: "int", nullable: true, comment: "年级ID"),
|
||
GradeName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "年级名称"),
|
||
ClassId = table.Column<int>(type: "int", nullable: true, comment: "班级ID"),
|
||
ClassName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "班级名称"),
|
||
GroupName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "组别"),
|
||
GroupOrder = table.Column<int>(type: "int", nullable: true, comment: "组号"),
|
||
TeacherId = table.Column<int>(type: "int", nullable: true, comment: "老师ID"),
|
||
DeviceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "设备ID"),
|
||
StudentId = table.Column<int>(type: "int", nullable: true, comment: "学生ID"),
|
||
StudentName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学生名称"),
|
||
Sex = table.Column<double>(type: "float", nullable: true, comment: "性别(1男2女)"),
|
||
StudentNo = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "学号"),
|
||
Achievement = table.Column<int>(type: "int", nullable: true, comment: "标准成绩"),
|
||
OriginalAchievement = table.Column<int>(type: "int", nullable: true, comment: "原始标准成绩(被格式化小数点之前的)"),
|
||
Achievement2 = table.Column<int>(type: "int", nullable: true, comment: "标准成绩2"),
|
||
OriginalAchievement2 = table.Column<int>(type: "int", nullable: true, comment: "原始标准成绩2(被格式化小数点之前的)"),
|
||
Score = table.Column<double>(type: "float", nullable: true, comment: "得分"),
|
||
PlusesScore = table.Column<double>(type: "float", nullable: true, comment: "加分项得分"),
|
||
Rating = table.Column<int>(type: "int", nullable: true, comment: "评分等级"),
|
||
RankingInGender = table.Column<int>(type: "int", nullable: true, comment: "男生或女生排名"),
|
||
Ranking = table.Column<int>(type: "int", nullable: true, comment: "全体排名"),
|
||
ErrorCount = table.Column<int>(type: "int", nullable: true, comment: "失误总次数"),
|
||
ErrorTime = table.Column<int>(type: "int", nullable: true, comment: "失误总耗时"),
|
||
AvgTime = table.Column<int>(type: "int", nullable: true, comment: "平均耗时"),
|
||
MedianTime = table.Column<int>(type: "int", nullable: true, comment: "有效平均值(中位数)"),
|
||
LossesCount1 = table.Column<int>(type: "int", nullable: true, comment: "失误损失次数"),
|
||
LossesCount2 = table.Column<int>(type: "int", nullable: true, comment: "甩绳速度偏慢损失次数"),
|
||
LossesCount3 = table.Column<int>(type: "int", nullable: true, comment: "进入状态过慢损失次数"),
|
||
HigherScore = table.Column<int>(type: "int", nullable: true, comment: "高一档分数段"),
|
||
IntoStateTime = table.Column<int>(type: "int", nullable: true, comment: "进入状态耗时"),
|
||
ImproveCount = table.Column<int>(type: "int", nullable: true, comment: "次数提升空间"),
|
||
ImproveScore = table.Column<double>(type: "float", nullable: true, comment: "分数提升空间"),
|
||
FamilySendFlag = table.Column<int>(type: "int", nullable: true, comment: "家长消息发送标识"),
|
||
Completed = table.Column<bool>(type: "bit", nullable: true, comment: "是否已经完成"),
|
||
QuantityCompleted = table.Column<int>(type: "int", nullable: true, comment: "实际完成的数量(圈数)"),
|
||
ModelType = table.Column<int>(type: "int", nullable: true, comment: "报表显示"),
|
||
StartTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "开始时间"),
|
||
Teacher = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "教师"),
|
||
CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建时间"),
|
||
CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "创建人"),
|
||
UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "修改时间"),
|
||
UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "修改人"),
|
||
XW_SportsTestDataId = table.Column<int>(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");
|
||
}
|
||
}
|
||
}
|