You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.0 KiB
63 lines
2.0 KiB
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace EntityFramwork.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class test3 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Skins_Champions_ChampionId",
|
|
table: "Skins");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "ChampionId",
|
|
table: "Skins",
|
|
newName: "ChampionForeignKey");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Skins_ChampionId",
|
|
table: "Skins",
|
|
newName: "IX_Skins_ChampionForeignKey");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Skins_Champions_ChampionForeignKey",
|
|
table: "Skins",
|
|
column: "ChampionForeignKey",
|
|
principalTable: "Champions",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Skins_Champions_ChampionForeignKey",
|
|
table: "Skins");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "ChampionForeignKey",
|
|
table: "Skins",
|
|
newName: "ChampionId");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Skins_ChampionForeignKey",
|
|
table: "Skins",
|
|
newName: "IX_Skins_ChampionId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Skins_Champions_ChampionId",
|
|
table: "Skins",
|
|
column: "ChampionId",
|
|
principalTable: "Champions",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|