YD_SmartSports.Api/VOL.Core/Migrations/20241218083630_1218v1.cs
2025-06-06 16:00:39 +08:00

255 lines
14 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class _1218v1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Ai_SpecialVideo");
migrationBuilder.DropTable(
name: "Ai_SpecialExplain");
migrationBuilder.DropTable(
name: "Ai_SpecialCourse");
migrationBuilder.DropTable(
name: "Ai_SpecialChapter");
migrationBuilder.DropTable(
name: "Ai_SpecialUnit");
migrationBuilder.CreateTable(
name: "Ai_SpecialLevel",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialId = table.Column<int>(type: "int", nullable: false, comment: "专项Id"),
LevelName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "水平名称"),
StartGrade = table.Column<int>(type: "int", nullable: false, comment: "开始年级"),
EndGrade = 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: "修改时间")
},
constraints: table =>
{
table.PrimaryKey("PK_Ai_SpecialLevel", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialLevel_Ai_Special_SpecialId",
column: x => x.SpecialId,
principalTable: "Ai_Special",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Ai_SpecialAction",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialLevelId = table.Column<int>(type: "int", nullable: false, comment: "专项水平Id"),
ActionName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "动作名称"),
ActionType = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "动作类型"),
ActionVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "动作示范-视频路径"),
ExplainVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "要领讲解-视频路径"),
ExerciseVideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "练习方法-视频路径"),
StandardVideoPath = 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: "修改时间")
},
constraints: table =>
{
table.PrimaryKey("PK_Ai_SpecialAction", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialAction_Ai_SpecialLevel_SpecialLevelId",
column: x => x.SpecialLevelId,
principalTable: "Ai_SpecialLevel",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialAction_SpecialLevelId",
table: "Ai_SpecialAction",
column: "SpecialLevelId");
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialLevel_SpecialId",
table: "Ai_SpecialLevel",
column: "SpecialId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Ai_SpecialAction");
migrationBuilder.DropTable(
name: "Ai_SpecialLevel");
migrationBuilder.CreateTable(
name: "Ai_SpecialUnit",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialId = table.Column<int>(type: "int", nullable: false, comment: "专项Id"),
ChapterNumber = table.Column<int>(type: "int", nullable: false, comment: "章节数量"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
EndGrade = table.Column<int>(type: "int", nullable: false, comment: "结束等级"),
Modifier = table.Column<int>(type: "int", nullable: true, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
StartGrade = table.Column<int>(type: "int", nullable: false, comment: "开始等级"),
Subjects = table.Column<int>(type: "int", nullable: false, comment: "科目"),
UnitName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "单元名称")
},
constraints: table =>
{
table.PrimaryKey("PK_Ai_SpecialUnit", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialUnit_Ai_Special_SpecialId",
column: x => x.SpecialId,
principalTable: "Ai_Special",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Ai_SpecialChapter",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialUnitId = table.Column<int>(type: "int", nullable: false, comment: "专项单元Id"),
ChapterName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "章节名称"),
ChapterOrder = table.Column<int>(type: "int", nullable: false, 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_Ai_SpecialChapter", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialChapter_Ai_SpecialUnit_SpecialUnitId",
column: x => x.SpecialUnitId,
principalTable: "Ai_SpecialUnit",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Ai_SpecialCourse",
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: false, comment: "专项章节Id"),
CourseName = 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_Ai_SpecialCourse", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialCourse_Ai_SpecialChapter_SpecialChapterId",
column: x => x.SpecialChapterId,
principalTable: "Ai_SpecialChapter",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Ai_SpecialExplain",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialCourseId = table.Column<int>(type: "int", nullable: false, comment: "专项课程Id"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Creator = table.Column<int>(type: "int", nullable: true, comment: "创建人"),
ExplainName = table.Column<string>(type: "nvarchar(100)", 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_Ai_SpecialExplain", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialExplain_Ai_SpecialCourse_SpecialCourseId",
column: x => x.SpecialCourseId,
principalTable: "Ai_SpecialCourse",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Ai_SpecialVideo",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SpecialExplainId = table.Column<int>(type: "int", nullable: false, comment: "专项讲解Id"),
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: "修改时间"),
Photo = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "照片"),
VideoName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "视频名称"),
VideoPath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "视频路径")
},
constraints: table =>
{
table.PrimaryKey("PK_Ai_SpecialVideo", x => x.Id);
table.ForeignKey(
name: "FK_Ai_SpecialVideo_Ai_SpecialExplain_SpecialExplainId",
column: x => x.SpecialExplainId,
principalTable: "Ai_SpecialExplain",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialChapter_SpecialUnitId",
table: "Ai_SpecialChapter",
column: "SpecialUnitId");
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialCourse_SpecialChapterId",
table: "Ai_SpecialCourse",
column: "SpecialChapterId");
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialExplain_SpecialCourseId",
table: "Ai_SpecialExplain",
column: "SpecialCourseId");
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialUnit_SpecialId",
table: "Ai_SpecialUnit",
column: "SpecialId");
migrationBuilder.CreateIndex(
name: "IX_Ai_SpecialVideo_SpecialExplainId",
table: "Ai_SpecialVideo",
column: "SpecialExplainId");
}
}
}