using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace HyperBooru.Migrations
{
///
public partial class TagDefinitionId : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tags_TagDefinitions_TagDefinitionObjectId",
table: "Tags");
migrationBuilder.RenameColumn(
name: "TagDefinitionObjectId",
table: "Tags",
newName: "TagDefinitionId");
migrationBuilder.RenameIndex(
name: "IX_Tags_TagDefinitionObjectId",
table: "Tags",
newName: "IX_Tags_TagDefinitionId");
migrationBuilder.AddForeignKey(
name: "FK_Tags_TagDefinitions_TagDefinitionId",
table: "Tags",
column: "TagDefinitionId",
principalTable: "TagDefinitions",
principalColumn: "ObjectId",
onDelete: ReferentialAction.Cascade);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tags_TagDefinitions_TagDefinitionId",
table: "Tags");
migrationBuilder.RenameColumn(
name: "TagDefinitionId",
table: "Tags",
newName: "TagDefinitionObjectId");
migrationBuilder.RenameIndex(
name: "IX_Tags_TagDefinitionId",
table: "Tags",
newName: "IX_Tags_TagDefinitionObjectId");
migrationBuilder.AddForeignKey(
name: "FK_Tags_TagDefinitions_TagDefinitionObjectId",
table: "Tags",
column: "TagDefinitionObjectId",
principalTable: "TagDefinitions",
principalColumn: "ObjectId",
onDelete: ReferentialAction.Cascade);
}
}
}