169 lines
7.9 KiB
C#
169 lines
7.9 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace VOL.Core.Migrations
|
|
{
|
|
public partial class _20260128v1 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "JS_SpecialId",
|
|
table: "Ai_SpecialLevel",
|
|
type: "int",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "JS_SpecialLevelId",
|
|
table: "Ai_SpecialAction",
|
|
type: "int",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "JS_Special",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
SpecialName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "专项名称"),
|
|
ImageUrl = 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_JS_Special", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "JS_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_JS_SpecialAction", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_JS_SpecialAction_Ai_SpecialLevel_SpecialLevelId",
|
|
column: x => x.SpecialLevelId,
|
|
principalTable: "Ai_SpecialLevel",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "JS_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_JS_SpecialLevel", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_JS_SpecialLevel_Ai_Special_SpecialId",
|
|
column: x => x.SpecialId,
|
|
principalTable: "Ai_Special",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Ai_SpecialLevel_JS_SpecialId",
|
|
table: "Ai_SpecialLevel",
|
|
column: "JS_SpecialId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Ai_SpecialAction_JS_SpecialLevelId",
|
|
table: "Ai_SpecialAction",
|
|
column: "JS_SpecialLevelId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_JS_SpecialAction_SpecialLevelId",
|
|
table: "JS_SpecialAction",
|
|
column: "SpecialLevelId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_JS_SpecialLevel_SpecialId",
|
|
table: "JS_SpecialLevel",
|
|
column: "SpecialId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialAction_JS_SpecialLevel_JS_SpecialLevelId",
|
|
table: "Ai_SpecialAction",
|
|
column: "JS_SpecialLevelId",
|
|
principalTable: "JS_SpecialLevel",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialLevel_JS_Special_JS_SpecialId",
|
|
table: "Ai_SpecialLevel",
|
|
column: "JS_SpecialId",
|
|
principalTable: "JS_Special",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialAction_JS_SpecialLevel_JS_SpecialLevelId",
|
|
table: "Ai_SpecialAction");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialLevel_JS_Special_JS_SpecialId",
|
|
table: "Ai_SpecialLevel");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "JS_Special");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "JS_SpecialAction");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "JS_SpecialLevel");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Ai_SpecialLevel_JS_SpecialId",
|
|
table: "Ai_SpecialLevel");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Ai_SpecialAction_JS_SpecialLevelId",
|
|
table: "Ai_SpecialAction");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "JS_SpecialId",
|
|
table: "Ai_SpecialLevel");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "JS_SpecialLevelId",
|
|
table: "Ai_SpecialAction");
|
|
}
|
|
}
|
|
}
|