using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace VOL.Core.Migrations { public partial class init040 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "I_Special", 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"), SpecialName = table.Column(type: "nvarchar(100)", nullable: true, comment: "专项名称"), Creator = table.Column(type: "int", nullable: true, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int", nullable: true, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间") }, constraints: table => { table.PrimaryKey("PK_I_Special", x => x.Id); }); migrationBuilder.CreateTable( name: "I_SpecialUnit", 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"), UnitName = table.Column(type: "nvarchar(100)", nullable: true, comment: "单元名称"), ChapterNumber = table.Column(type: "int", nullable: false, comment: "单元数量"), Creator = table.Column(type: "int", nullable: true, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int", nullable: true, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), SpecialId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_SpecialUnit", x => x.Id); table.ForeignKey( name: "FK_I_SpecialUnit_I_Special_SpecialId", column: x => x.SpecialId, principalTable: "I_Special", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "I_SpecialChapter", 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"), ChapterName = table.Column(type: "nvarchar(100)", nullable: true, comment: "章节名称"), Creator = table.Column(type: "int", nullable: true, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int", nullable: true, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), SpecialUnitId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_SpecialChapter", x => x.Id); table.ForeignKey( name: "FK_I_SpecialChapter_I_SpecialUnit_SpecialUnitId", column: x => x.SpecialUnitId, principalTable: "I_SpecialUnit", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "I_SpecialTeaching", 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"), ActionName = table.Column(type: "nvarchar(100)", nullable: true, comment: "动作名称"), ActionExplanationVideoPath = table.Column(type: "nvarchar(2000)", nullable: true, comment: "动作讲解视频路径"), ActionExerciseVideoPath = table.Column(type: "nvarchar(2000)", nullable: true, comment: "动作练习视频路径"), Creator = table.Column(type: "int", nullable: true, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int", nullable: true, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), SpecialChapterId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_SpecialTeaching", x => x.Id); table.ForeignKey( name: "FK_I_SpecialTeaching_I_SpecialChapter_SpecialChapterId", column: x => x.SpecialChapterId, principalTable: "I_SpecialChapter", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "I_SpecialTraining", 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"), TrainingName = table.Column(type: "nvarchar(100)", nullable: true, comment: "训练名称"), TrainingVideoPath = table.Column(type: "nvarchar(2000)", nullable: true, comment: "训练视频路径"), Creator = table.Column(type: "int", nullable: true, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int", nullable: true, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), SpecialChapterId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_I_SpecialTraining", x => x.Id); table.ForeignKey( name: "FK_I_SpecialTraining_I_SpecialChapter_SpecialChapterId", column: x => x.SpecialChapterId, principalTable: "I_SpecialChapter", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_I_SpecialChapter_SpecialUnitId", table: "I_SpecialChapter", column: "SpecialUnitId"); migrationBuilder.CreateIndex( name: "IX_I_SpecialTeaching_SpecialChapterId", table: "I_SpecialTeaching", column: "SpecialChapterId"); migrationBuilder.CreateIndex( name: "IX_I_SpecialTraining_SpecialChapterId", table: "I_SpecialTraining", column: "SpecialChapterId"); migrationBuilder.CreateIndex( name: "IX_I_SpecialUnit_SpecialId", table: "I_SpecialUnit", column: "SpecialId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "I_SpecialTeaching"); migrationBuilder.DropTable( name: "I_SpecialTraining"); migrationBuilder.DropTable( name: "I_SpecialChapter"); migrationBuilder.DropTable( name: "I_SpecialUnit"); migrationBuilder.DropTable( name: "I_Special"); } } }