CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopDataBaseImplement/Migrations/20240724085609_05.cs

49 lines
1.4 KiB
C#
Raw Normal View History

2024-07-24 13:02:15 +04:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ElectronicsShopDataBaseImplement.Migrations
{
/// <inheritdoc />
public partial class _05 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "PaymentID",
table: "Paymeants",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Paymeants_PaymentID",
table: "Paymeants",
column: "PaymentID");
migrationBuilder.AddForeignKey(
name: "FK_Paymeants_Orders_PaymentID",
table: "Paymeants",
column: "PaymentID",
principalTable: "Orders",
principalColumn: "ID");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Paymeants_Orders_PaymentID",
table: "Paymeants");
migrationBuilder.DropIndex(
name: "IX_Paymeants_PaymentID",
table: "Paymeants");
migrationBuilder.DropColumn(
name: "PaymentID",
table: "Paymeants");
}
}
}