40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace SushiBarDatabaseImplement.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class SecondMigration : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Orders_SushiId",
|
|||
|
table: "Orders",
|
|||
|
column: "SushiId");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Orders_SushiList_SushiId",
|
|||
|
table: "Orders",
|
|||
|
column: "SushiId",
|
|||
|
principalTable: "SushiList",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Orders_SushiList_SushiId",
|
|||
|
table: "Orders");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Orders_SushiId",
|
|||
|
table: "Orders");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|