169 lines
6.0 KiB
C#
169 lines
6.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Church.Net.DAL.EFCoreDBF.Migrations
|
|
{
|
|
public partial class AddMD2MobInfoUpdateId : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId1",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Md2MobLevelInfos_MobInfoId1",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "MobInfoId1",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "MobInfoId2",
|
|
table: "Md2MobLevelInfos",
|
|
type: "text",
|
|
nullable: true,
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uuid");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "MobInfoId",
|
|
table: "Md2MobLevelInfos",
|
|
type: "text",
|
|
nullable: true,
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uuid");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Id",
|
|
table: "Md2MobLevelInfos",
|
|
type: "text",
|
|
nullable: false,
|
|
defaultValueSql: "uuid_generate_v4()",
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uuid",
|
|
oldDefaultValueSql: "uuid_generate_v4()");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Id",
|
|
table: "Md2MobInfos",
|
|
type: "text",
|
|
nullable: false,
|
|
defaultValueSql: "uuid_generate_v4()",
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uuid",
|
|
oldDefaultValueSql: "uuid_generate_v4()");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Md2MobLevelInfos_MobInfoId2",
|
|
table: "Md2MobLevelInfos",
|
|
column: "MobInfoId2");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
|
|
table: "Md2MobLevelInfos",
|
|
column: "MobInfoId",
|
|
principalTable: "Md2MobInfos",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId2",
|
|
table: "Md2MobLevelInfos",
|
|
column: "MobInfoId2",
|
|
principalTable: "Md2MobInfos",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId2",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Md2MobLevelInfos_MobInfoId2",
|
|
table: "Md2MobLevelInfos");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "MobInfoId2",
|
|
table: "Md2MobLevelInfos",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "MobInfoId",
|
|
table: "Md2MobLevelInfos",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "Id",
|
|
table: "Md2MobLevelInfos",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValueSql: "uuid_generate_v4()",
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldDefaultValueSql: "uuid_generate_v4()");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "MobInfoId1",
|
|
table: "Md2MobLevelInfos",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "Id",
|
|
table: "Md2MobInfos",
|
|
type: "uuid",
|
|
nullable: false,
|
|
defaultValueSql: "uuid_generate_v4()",
|
|
oldClrType: typeof(string),
|
|
oldType: "text",
|
|
oldDefaultValueSql: "uuid_generate_v4()");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Md2MobLevelInfos_MobInfoId1",
|
|
table: "Md2MobLevelInfos",
|
|
column: "MobInfoId1");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
|
|
table: "Md2MobLevelInfos",
|
|
column: "MobInfoId",
|
|
principalTable: "Md2MobInfos",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId1",
|
|
table: "Md2MobLevelInfos",
|
|
column: "MobInfoId1",
|
|
principalTable: "Md2MobInfos",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|