YD_SmartSports.Api/VOL.Core/Migrations/20240824124613_init043.cs

175 lines
9.0 KiB
C#
Raw 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 init043 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "I_SpecialTeaching");
migrationBuilder.DropTable(
name: "I_SpecialTraining");
migrationBuilder.CreateTable(
name: "I_SpecialCourse",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
CourseName = 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: "修改时间"),
SpecialChapterId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_I_SpecialCourse", x => x.Id);
table.ForeignKey(
name: "FK_I_SpecialCourse_I_SpecialChapter_SpecialChapterId",
column: x => x.SpecialChapterId,
principalTable: "I_SpecialChapter",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "I_SpecialExplain",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
ExplainName = 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: "修改时间"),
SpecialCourseId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_I_SpecialExplain", x => x.Id);
table.ForeignKey(
name: "FK_I_SpecialExplain_I_SpecialCourse_SpecialCourseId",
column: x => x.SpecialCourseId,
principalTable: "I_SpecialCourse",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "I_SpecialVideo",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
VideoName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "视频名称"),
VideoPath = 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: "修改时间"),
SpecialExplainId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_I_SpecialVideo", x => x.Id);
table.ForeignKey(
name: "FK_I_SpecialVideo_I_SpecialExplain_SpecialExplainId",
column: x => x.SpecialExplainId,
principalTable: "I_SpecialExplain",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_I_SpecialCourse_SpecialChapterId",
table: "I_SpecialCourse",
column: "SpecialChapterId");
migrationBuilder.CreateIndex(
name: "IX_I_SpecialExplain_SpecialCourseId",
table: "I_SpecialExplain",
column: "SpecialCourseId");
migrationBuilder.CreateIndex(
name: "IX_I_SpecialVideo_SpecialExplainId",
table: "I_SpecialVideo",
column: "SpecialExplainId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "I_SpecialVideo");
migrationBuilder.DropTable(
name: "I_SpecialExplain");
migrationBuilder.DropTable(
name: "I_SpecialCourse");
migrationBuilder.CreateTable(
name: "I_SpecialTeaching",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialChapterId = table.Column<int>(type: "int", nullable: true),
ActionExerciseVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "动作练习视频路径"),
ActionExplanationVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "动作讲解视频路径"),
ActionName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "动作名称"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Creator = table.Column<int>(type: "int", 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_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"),
SpecialChapterId = table.Column<int>(type: "int", nullable: true),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
TrainingName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "训练名称"),
TrainingVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "训练视频路径")
},
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_SpecialTeaching_SpecialChapterId",
table: "I_SpecialTeaching",
column: "SpecialChapterId");
migrationBuilder.CreateIndex(
name: "IX_I_SpecialTraining_SpecialChapterId",
table: "I_SpecialTraining",
column: "SpecialChapterId");
}
}
}