YD_SmartSports.Api/VOL.Core/Migrations/20240718135814_init024.cs

139 lines
9.4 KiB
C#
Raw Normal View History

2025-06-06 16:00:39 +08:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init024 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// Drop table if exists
migrationBuilder.Sql(@"IF OBJECT_ID('dbo.I_SportsTestData', 'U') IS NOT NULL
DROP TABLE [dbo].[I_SportsTestData];");
// Create table I_SportsTestData
migrationBuilder.CreateTable(
name: "I_SportsTestData",
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"),
SchoolName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校名称"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级Id"),
GradeName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "年级名称"),
ClassId = table.Column<int>(type: "int", nullable: false, comment: "班级Id"),
ClassName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "班级名称"),
TeacherId = table.Column<int>(type: "int", nullable: false, comment: "老师Id"),
TeacherName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "老师姓名"),
StudentNo = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学号"),
StudentName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "姓名"),
StudenNumber = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学生邀请码"),
Gender = table.Column<int>(type: "int", nullable: false, comment: "性别"),
Height = table.Column<float>(type: "float", nullable: true, comment: "身高"),
Weight = table.Column<float>(type: "float", nullable: true, comment: "体重"),
Pulmonary = table.Column<int>(type: "int", nullable: true, comment: "肺活量"),
Speed = table.Column<float>(type: "float", nullable: true, comment: "50米"),
Pliable = table.Column<float>(type: "float", nullable: true, comment: "坐位体前屈"),
Rope = table.Column<int>(type: "int", nullable: true, comment: "一分钟跳绳"),
Situp = table.Column<int>(type: "int", nullable: true, comment: "一分钟仰卧起坐"),
Speedeight = table.Column<float>(type: "float", nullable: true, comment: "50米*8 往返跑"),
Standing = table.Column<float>(type: "float", nullable: true, comment: "立定跳远"),
Chinning = table.Column<int>(type: "int", nullable: true, comment: "引体向上"),
Kilometer = table.Column<float>(type: "float", nullable: true, comment: "1000米"),
Hectometer = table.Column<float>(type: "float", nullable: true, comment: "800米"),
ScoreTime = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "提交时间")
},
constraints: table =>
{
table.PrimaryKey("PK_I_SportsTestData", x => x.Id);
});
// Create table I_TrainingData
migrationBuilder.CreateTable(
name: "I_TrainingData",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
DataSource = table.Column<int>(type: "int", nullable: false, comment: "数据来源"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级编号"),
ClassId = table.Column<int>(type: "int", nullable: false, comment: "班级Id"),
TeacherId = table.Column<int>(type: "int", nullable: false, comment: "老师Id"),
ItemType = table.Column<int>(type: "int", nullable: false, comment: "项目类型"),
InsertTime = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "开始时间"),
EndTime = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "结束时间"),
TotalNumber = table.Column<int>(type: "int", nullable: false, comment: "参与人数"),
TtotalGroup = table.Column<int>(type: "int", nullable: false, comment: "总轮次"),
TrainType = table.Column<int>(type: "int", nullable: false, comment: "训练类型"),
ModeType = table.Column<int>(type: "int", nullable: false, comment: "模式类型"),
ModelName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "模式名称"),
LimitTime = table.Column<int>(type: "int", nullable: false, comment: "限时"),
LimitNumber = table.Column<int>(type: "int", nullable: false, comment: "限数"),
ClassScore = table.Column<int>(type: "int", nullable: false, comment: "训练成绩"),
BoyLevelHigh = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "男孩优秀的评分标准"),
BoyLevelMiddle = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "男孩良好的评分标准"),
BoyLevelLow = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "男孩及格的评分标准"),
GirlLevelHigh = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "女孩优秀的评分标准"),
GirlLevelMiddle = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "女孩良好的评分标准"),
GirlLevelLow = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "女孩及格的评分标准")
},
constraints: table =>
{
table.PrimaryKey("PK_I_TrainingData", x => x.Id);
});
// Create table I_TrainingStudentData
migrationBuilder.CreateTable(
name: "I_TrainingStudentData",
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: "姓名"),
Gender = table.Column<int>(type: "int", nullable: false, comment: "性别"),
SecondsNumber = table.Column<float>(type: "float", nullable: true, comment: "每秒"),
SpeedTime = table.Column<float>(type: "float", nullable: true, comment: "数值"),
Kcal = table.Column<float>(type: "float", nullable: false, comment: "能耗"),
Efficiency = table.Column<float>(type: "float", nullable: true, comment: "握力"),
ResultLevel = table.Column<int>(type: "int", nullable: true, comment: "训练成绩"),
JumpValue = table.Column<int>(type: "int", nullable: true, comment: "个数"),
ErrorNumber = table.Column<int>(type: "int", nullable: true, comment: "错误个数"),
StuAgileSpeedTimeNumber = table.Column<int>(type: "int", nullable: true, comment: "正确个数"),
HeartRatePercentage = table.Column<int>(type: "int", nullable: true, comment: "心率强度"),
HighHeartRate = table.Column<int>(type: "int", nullable: true, comment: "最高心率"),
LowHeartRate = table.Column<int>(type: "int", nullable: true, comment: "最低心率"),
TrainingDataId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_I_TrainingStudentData", x => x.Id);
table.ForeignKey(
name: "FK_I_TrainingStudentData_I_TrainingData_TrainingDataId",
column: x => x.TrainingDataId,
principalTable: "I_TrainingData",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_I_TrainingStudentData_TrainingDataId",
table: "I_TrainingStudentData",
column: "TrainingDataId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "I_SportsTestData");
migrationBuilder.DropTable(
name: "I_TrainingStudentData");
migrationBuilder.DropTable(
name: "I_TrainingData");
}
}
}