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(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校Code"), SchoolName = 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: "班级名称"), TeacherId = table.Column(type: "int", nullable: false, comment: "老师Id"), TeacherName = table.Column(type: "nvarchar(100)", nullable: true, comment: "老师姓名"), StudentNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学号"), StudentName = table.Column(type: "nvarchar(100)", nullable: true, comment: "姓名"), StudenNumber = table.Column(type: "nvarchar(100)", nullable: true, comment: "学生邀请码"), Gender = table.Column(type: "int", nullable: false, comment: "性别"), Height = table.Column(type: "float", nullable: true, comment: "身高"), Weight = table.Column(type: "float", nullable: true, comment: "体重"), Pulmonary = table.Column(type: "int", nullable: true, comment: "肺活量"), Speed = table.Column(type: "float", nullable: true, comment: "50米"), Pliable = table.Column(type: "float", nullable: true, comment: "坐位体前屈"), Rope = table.Column(type: "int", nullable: true, comment: "一分钟跳绳"), Situp = table.Column(type: "int", nullable: true, comment: "一分钟仰卧起坐"), Speedeight = table.Column(type: "float", nullable: true, comment: "50米*8 往返跑"), Standing = table.Column(type: "float", nullable: true, comment: "立定跳远"), Chinning = table.Column(type: "int", nullable: true, comment: "引体向上"), Kilometer = table.Column(type: "float", nullable: true, comment: "1000米"), Hectometer = table.Column(type: "float", nullable: true, comment: "800米"), ScoreTime = table.Column(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(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), DataSource = table.Column(type: "int", nullable: false, comment: "数据来源"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校Code"), GradeId = table.Column(type: "int", nullable: false, comment: "年级编号"), ClassId = table.Column(type: "int", nullable: false, comment: "班级Id"), TeacherId = table.Column(type: "int", nullable: false, comment: "老师Id"), ItemType = table.Column(type: "int", nullable: false, comment: "项目类型"), InsertTime = table.Column(type: "nvarchar(100)", nullable: true, comment: "开始时间"), EndTime = table.Column(type: "nvarchar(100)", nullable: true, comment: "结束时间"), TotalNumber = table.Column(type: "int", nullable: false, comment: "参与人数"), TtotalGroup = table.Column(type: "int", nullable: false, comment: "总轮次"), TrainType = table.Column(type: "int", nullable: false, comment: "训练类型"), ModeType = table.Column(type: "int", nullable: false, comment: "模式类型"), ModelName = table.Column(type: "nvarchar(100)", nullable: true, comment: "模式名称"), LimitTime = table.Column(type: "int", nullable: false, comment: "限时"), LimitNumber = table.Column(type: "int", nullable: false, comment: "限数"), ClassScore = table.Column(type: "int", nullable: false, comment: "训练成绩"), BoyLevelHigh = table.Column(type: "nvarchar(100)", nullable: true, comment: "男孩优秀的评分标准"), BoyLevelMiddle = table.Column(type: "nvarchar(100)", nullable: true, comment: "男孩良好的评分标准"), BoyLevelLow = table.Column(type: "nvarchar(100)", nullable: true, comment: "男孩及格的评分标准"), GirlLevelHigh = table.Column(type: "nvarchar(100)", nullable: true, comment: "女孩优秀的评分标准"), GirlLevelMiddle = table.Column(type: "nvarchar(100)", nullable: true, comment: "女孩良好的评分标准"), GirlLevelLow = table.Column(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(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), StudentNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学号"), StudentName = table.Column(type: "nvarchar(100)", nullable: true, comment: "姓名"), Gender = table.Column(type: "int", nullable: false, comment: "性别"), SecondsNumber = table.Column(type: "float", nullable: true, comment: "每秒"), SpeedTime = table.Column(type: "float", nullable: true, comment: "数值"), Kcal = table.Column(type: "float", nullable: false, comment: "能耗"), Efficiency = table.Column(type: "float", nullable: true, comment: "握力"), ResultLevel = table.Column(type: "int", nullable: true, comment: "训练成绩"), JumpValue = table.Column(type: "int", nullable: true, comment: "个数"), ErrorNumber = table.Column(type: "int", nullable: true, comment: "错误个数"), StuAgileSpeedTimeNumber = table.Column(type: "int", nullable: true, comment: "正确个数"), HeartRatePercentage = table.Column(type: "int", nullable: true, comment: "心率强度"), HighHeartRate = table.Column(type: "int", nullable: true, comment: "最高心率"), LowHeartRate = table.Column(type: "int", nullable: true, comment: "最低心率"), TrainingDataId = table.Column(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"); } } }