49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace DinerDataBaseImplement.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Migration03 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "SnackID",
|
|
table: "Orders",
|
|
type: "int",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Orders_SnackID",
|
|
table: "Orders",
|
|
column: "SnackID");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Orders_Products_SnackID",
|
|
table: "Orders",
|
|
column: "SnackID",
|
|
principalTable: "Products",
|
|
principalColumn: "ID");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Orders_Products_SnackID",
|
|
table: "Orders");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Orders_SnackID",
|
|
table: "Orders");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SnackID",
|
|
table: "Orders");
|
|
}
|
|
}
|
|
}
|