YD_SmartSports.Api/VOL.Core/Migrations/20240821163926_init040.cs

169 lines
8.9 KiB
C#
Raw Permalink Normal View History

2025-06-06 16:00:39 +08:00
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<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
SpecialName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "专项名称"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(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<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
UnitName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "单元名称"),
ChapterNumber = table.Column<int>(type: "int", nullable: false, comment: "单元数量"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
SpecialId = table.Column<int>(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<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
ChapterName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "章节名称"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
SpecialUnitId = table.Column<int>(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<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
ActionName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "动作名称"),
ActionExplanationVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "动作讲解视频路径"),
ActionExerciseVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "动作练习视频路径"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
SpecialChapterId = table.Column<int>(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<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学校Code"),
TrainingName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "训练名称"),
TrainingVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "训练视频路径"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
SpecialChapterId = table.Column<int>(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");
}
}
}