187 lines
6.9 KiB
C#
187 lines
6.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace VOL.Core.Migrations
|
|
{
|
|
public partial class init046 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialChapter_Ai_SpecialUnit_SpecialUnitId",
|
|
table: "Ai_SpecialChapter");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialCourse_Ai_SpecialChapter_SpecialChapterId",
|
|
table: "Ai_SpecialCourse");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialExplain_Ai_SpecialCourse_SpecialCourseId",
|
|
table: "Ai_SpecialExplain");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialVideo_Ai_SpecialExplain_SpecialExplainId",
|
|
table: "Ai_SpecialVideo");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialExplainId",
|
|
table: "Ai_SpecialVideo",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "专项讲解Id",
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialCourseId",
|
|
table: "Ai_SpecialExplain",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "专项课程Id",
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialChapterId",
|
|
table: "Ai_SpecialCourse",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "专项章节Id",
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialUnitId",
|
|
table: "Ai_SpecialChapter",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "专项单元Id",
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialChapter_Ai_SpecialUnit_SpecialUnitId",
|
|
table: "Ai_SpecialChapter",
|
|
column: "SpecialUnitId",
|
|
principalTable: "Ai_SpecialUnit",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialCourse_Ai_SpecialChapter_SpecialChapterId",
|
|
table: "Ai_SpecialCourse",
|
|
column: "SpecialChapterId",
|
|
principalTable: "Ai_SpecialChapter",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialExplain_Ai_SpecialCourse_SpecialCourseId",
|
|
table: "Ai_SpecialExplain",
|
|
column: "SpecialCourseId",
|
|
principalTable: "Ai_SpecialCourse",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialVideo_Ai_SpecialExplain_SpecialExplainId",
|
|
table: "Ai_SpecialVideo",
|
|
column: "SpecialExplainId",
|
|
principalTable: "Ai_SpecialExplain",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialChapter_Ai_SpecialUnit_SpecialUnitId",
|
|
table: "Ai_SpecialChapter");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialCourse_Ai_SpecialChapter_SpecialChapterId",
|
|
table: "Ai_SpecialCourse");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialExplain_Ai_SpecialCourse_SpecialCourseId",
|
|
table: "Ai_SpecialExplain");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Ai_SpecialVideo_Ai_SpecialExplain_SpecialExplainId",
|
|
table: "Ai_SpecialVideo");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialExplainId",
|
|
table: "Ai_SpecialVideo",
|
|
type: "int",
|
|
nullable: true,
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldComment: "专项讲解Id");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialCourseId",
|
|
table: "Ai_SpecialExplain",
|
|
type: "int",
|
|
nullable: true,
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldComment: "专项课程Id");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialChapterId",
|
|
table: "Ai_SpecialCourse",
|
|
type: "int",
|
|
nullable: true,
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldComment: "专项章节Id");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "SpecialUnitId",
|
|
table: "Ai_SpecialChapter",
|
|
type: "int",
|
|
nullable: true,
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldComment: "专项单元Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialChapter_Ai_SpecialUnit_SpecialUnitId",
|
|
table: "Ai_SpecialChapter",
|
|
column: "SpecialUnitId",
|
|
principalTable: "Ai_SpecialUnit",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialCourse_Ai_SpecialChapter_SpecialChapterId",
|
|
table: "Ai_SpecialCourse",
|
|
column: "SpecialChapterId",
|
|
principalTable: "Ai_SpecialChapter",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialExplain_Ai_SpecialCourse_SpecialCourseId",
|
|
table: "Ai_SpecialExplain",
|
|
column: "SpecialCourseId",
|
|
principalTable: "Ai_SpecialCourse",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Ai_SpecialVideo_Ai_SpecialExplain_SpecialExplainId",
|
|
table: "Ai_SpecialVideo",
|
|
column: "SpecialExplainId",
|
|
principalTable: "Ai_SpecialExplain",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
} |