Church.Net.API/Church.Net.DAL.EFCoreDBF/Migrations/20240502213000_AddMD2MobInfo.cs
2024-05-02 15:24:13 -07:00

72 lines
2.7 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddMD2MobInfo : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Md2MobInfos",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false, defaultValueSql: "uuid_generate_v4()"),
Type = table.Column<int>(type: "integer", nullable: false),
From = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Md2MobInfos", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Md2MobLevelInfos",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false, defaultValueSql: "uuid_generate_v4()"),
MobInfoId = table.Column<Guid>(type: "uuid", nullable: false),
MobInfoId1 = table.Column<Guid>(type: "uuid", nullable: false),
MobInfoId2 = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Md2MobLevelInfos", x => x.Id);
table.ForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
column: x => x.MobInfoId,
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId1",
column: x => x.MobInfoId1,
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Md2MobLevelInfos_MobInfoId",
table: "Md2MobLevelInfos",
column: "MobInfoId");
migrationBuilder.CreateIndex(
name: "IX_Md2MobLevelInfos_MobInfoId1",
table: "Md2MobLevelInfos",
column: "MobInfoId1");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Md2MobLevelInfos");
migrationBuilder.DropTable(
name: "Md2MobInfos");
}
}
}