PIbd-21_Balberova_D.N._Sush.../SushiBar/SushiBarDatabaseImplement/Migrations/20230227181342_SecondMigration.cs

40 lines
1.1 KiB
C#
Raw Normal View History

2023-02-27 22:16:28 +04:00
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(
2023-03-10 16:44:26 +04:00
name: "FK_Orders_ListSushi_SushiId",
2023-02-27 22:16:28 +04:00
table: "Orders",
column: "SushiId",
2023-03-10 16:44:26 +04:00
principalTable: "ListSushi",
2023-02-27 22:16:28 +04:00
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
2023-03-10 16:44:26 +04:00
name: "FK_Orders_ListSushi_SushiId",
2023-02-27 22:16:28 +04:00
table: "Orders");
migrationBuilder.DropIndex(
name: "IX_Orders_SushiId",
table: "Orders");
}
}
}