96 lines
3.0 KiB
C#
96 lines
3.0 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ComputerShopDatabaseImplement.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class supplymig : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
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<int>(
|
|
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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
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<int>(
|
|
name: "ReceivingId",
|
|
table: "Supplies",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "SupplyId",
|
|
table: "EquipmentReceivings",
|
|
type: "int",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
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");
|
|
}
|
|
}
|
|
}
|