using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ComputerShopDatabaseImplement.Migrations
{
///
public partial class supplymig : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EquipmentReceivings_Supplies_SupplyId",
table: "EquipmentReceivings");
migrationBuilder.DropIndex(
name: "IX_EquipmentReceivings_SupplyId",
table: "EquipmentReceivings");
migrationBuilder.DropColumn(
name: "SupplyId",
table: "EquipmentReceivings");
migrationBuilder.AlterColumn(
name: "ReceivingId",
table: "Supplies",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.CreateIndex(
name: "IX_Supplies_ReceivingId",
table: "Supplies",
column: "ReceivingId");
migrationBuilder.AddForeignKey(
name: "FK_Supplies_EquipmentReceivings_ReceivingId",
table: "Supplies",
column: "ReceivingId",
principalTable: "EquipmentReceivings",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Supplies_EquipmentReceivings_ReceivingId",
table: "Supplies");
migrationBuilder.DropIndex(
name: "IX_Supplies_ReceivingId",
table: "Supplies");
migrationBuilder.AlterColumn(
name: "ReceivingId",
table: "Supplies",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AddColumn(
name: "SupplyId",
table: "EquipmentReceivings",
type: "int",
nullable: true);
migrationBuilder.AlterColumn(
name: "ClientId",
table: "Assemblies",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.CreateIndex(
name: "IX_EquipmentReceivings_SupplyId",
table: "EquipmentReceivings",
column: "SupplyId");
migrationBuilder.AddForeignKey(
name: "FK_EquipmentReceivings_Supplies_SupplyId",
table: "EquipmentReceivings",
column: "SupplyId",
principalTable: "Supplies",
principalColumn: "Id");
}
}
}