CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopDataBaseImplement/Migrations/20240724094839_Migration07.cs
Илья Федотов ae632c5cb4 fix
2024-07-24 13:51:49 +04:00

70 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ElectronicsShopDataBaseImplement.Migrations
{
/// <inheritdoc />
public partial class Migration07 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Paymeants_Orders_OrderID",
table: "Paymeants");
migrationBuilder.DropIndex(
name: "IX_Paymeants_OrderID",
table: "Paymeants");
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");
migrationBuilder.CreateIndex(
name: "IX_Paymeants_OrderID",
table: "Paymeants",
column: "OrderID");
migrationBuilder.AddForeignKey(
name: "FK_Paymeants_Orders_OrderID",
table: "Paymeants",
column: "OrderID",
principalTable: "Orders",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
}
}
}