using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ComputerHardwareStoreDatabaseImplement.Migrations
{
///
public partial class cs2 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "Count",
table: "Orders",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn(
name: "ProductId",
table: "Orders",
type: "integer",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Orders_ProductId",
table: "Orders",
column: "ProductId");
migrationBuilder.AddForeignKey(
name: "FK_Orders_Products_ProductId",
table: "Orders",
column: "ProductId",
principalTable: "Products",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Orders_Products_ProductId",
table: "Orders");
migrationBuilder.DropIndex(
name: "IX_Orders_ProductId",
table: "Orders");
migrationBuilder.DropColumn(
name: "Count",
table: "Orders");
migrationBuilder.DropColumn(
name: "ProductId",
table: "Orders");
}
}
}