YD_SmartSports.Api/VOL.Core/Migrations/20240914085214_init062.cs
2025-06-06 16:00:39 +08:00

95 lines
6.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using System;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init062 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Ai_TrainingData",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
Code = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "AI设备的唯一编码"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级编号"),
ClassId = table.Column<int>(type: "int", nullable: false, comment: "班级Id"),
GradeName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "年级名称"),
ClassName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "班级名称"),
StudentCount = table.Column<int>(type: "int", nullable: false, comment: "班级人数"),
TeacherId = table.Column<int>(type: "int", nullable: false, comment: "老师Id"),
TeacherPhone = table.Column<string>(type: "varchar(11)", nullable: true, comment: "老师手机号"),
ModeType = table.Column<int>(type: "int", nullable: false, comment: "模式类型"),
ModelName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "模式名称"),
TrainingModule = table.Column<int>(type: "int", nullable: false, comment: "训练模块"),
CategoryValue = table.Column<int>(type: "int", nullable: false, comment: "项目类型"),
StartTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
EndTime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
TotalNumber = table.Column<int>(type: "int", nullable: false, comment: "参与人数"),
TotalRound = table.Column<int>(type: "int", nullable: true, comment: "总轮次"),
LimitTime = table.Column<int>(type: "int", nullable: false, comment: "限时"),
LimitNumber = table.Column<int>(type: "int", nullable: false, comment: "限数"),
TrainingType = table.Column<int>(type: "int", nullable: true, comment: "标准赛类型"),
TrainingTime = table.Column<int>(type: "int", nullable: true, comment: "训练倒计时时间 (1, 2 分钟)"),
TotalTime = table.Column<int>(type: "int", nullable: true, comment: "限时限数总耗时")
},
constraints: table =>
{
table.PrimaryKey("PK_Ai_TrainingData", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Ai_TrainingDetailsData",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
StudentNo = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学号"),
StudentName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "姓名"),
Sex = table.Column<int>(type: "int", nullable: false, comment: "学校Co性别de"),
Value = table.Column<double>(type: "float", nullable: false, comment: "测试成绩"),
MotionDuration = table.Column<int>(type: "int", nullable: false, comment: "运动时长/分钟"),
Consumption = table.Column<int>(type: "int", nullable: false, comment: "运动消耗"),
Strength = table.Column<int>(type: "int", nullable: false, comment: "运动强度"),
Score = table.Column<double>(type: "float", nullable: false, comment: "得分"),
AdditionalScore = table.Column<double>(type: "float", nullable: false, comment: "附加分"),
Rank = table.Column<int>(type: "int", nullable: false, comment: "训练成绩等级"),
RankStr = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "等级"),
ErrorNumber = table.Column<int>(type: "int", nullable: true, comment: "错误个数"),
CorrectNumber = table.Column<int>(type: "int", nullable: true, comment: "正确个数"),
MaxValue = table.Column<int>(type: "int", nullable: true, comment: "最大"),
MinValue = table.Column<int>(type: "int", nullable: true, comment: "最小"),
EvaluationGrade = table.Column<int>(type: "int", nullable: false, comment: "测评等级"),
TrainingDataId = table.Column<int>(type: "int", nullable: true)
},
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");
});
migrationBuilder.CreateIndex(
name: "IX_Ai_TrainingDetailsData_TrainingDataId",
table: "Ai_TrainingDetailsData",
column: "TrainingDataId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Ai_TrainingDetailsData");
migrationBuilder.DropTable(
name: "Ai_TrainingData");
}
}
}