IW4M-Admin/SharedLibraryCore/Migrations/Postgresql/20210124170956_UpdateEFMetaToSupportLinkedMeta.cs

44 lines
1.3 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore.Migrations;
namespace SharedLibraryCore.Migrations.Postgresql
{
public partial class UpdateEFMetaToSupportLinkedMeta : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "LinkedMetaId",
table: "EFMeta",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_EFMeta_LinkedMetaId",
table: "EFMeta",
column: "LinkedMetaId");
migrationBuilder.AddForeignKey(
name: "FK_EFMeta_EFMeta_LinkedMetaId",
table: "EFMeta",
column: "LinkedMetaId",
principalTable: "EFMeta",
principalColumn: "MetaId",
onDelete: ReferentialAction.SetNull);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EFMeta_EFMeta_LinkedMetaId",
table: "EFMeta");
migrationBuilder.DropIndex(
name: "IX_EFMeta_LinkedMetaId",
table: "EFMeta");
migrationBuilder.DropColumn(
name: "LinkedMetaId",
table: "EFMeta");
}
}
}