using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ComputerShopDatabaseImplement.Migrations { /// public partial class fix : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_EquipmentReceivings_Clients_ClientId", table: "EquipmentReceivings"); migrationBuilder.DropForeignKey( name: "FK_Orders_Clients_ClientId", table: "Orders"); migrationBuilder.DropForeignKey( name: "FK_Supplies_Clients_ClientId", table: "Supplies"); migrationBuilder.AlterColumn( name: "ClientId", table: "Supplies", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AlterColumn( name: "ClientId", table: "Orders", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AlterColumn( name: "ClientId", table: "EquipmentReceivings", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_EquipmentReceivings_Clients_ClientId", table: "EquipmentReceivings", column: "ClientId", principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.NoAction); migrationBuilder.AddForeignKey( name: "FK_Orders_Clients_ClientId", table: "Orders", column: "ClientId", principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.NoAction); migrationBuilder.AddForeignKey( name: "FK_Supplies_Clients_ClientId", table: "Supplies", column: "ClientId", principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.NoAction); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_EquipmentReceivings_Clients_ClientId", table: "EquipmentReceivings"); migrationBuilder.DropForeignKey( name: "FK_Orders_Clients_ClientId", table: "Orders"); migrationBuilder.DropForeignKey( name: "FK_Supplies_Clients_ClientId", table: "Supplies"); migrationBuilder.AlterColumn( name: "ClientId", table: "Supplies", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AlterColumn( name: "ClientId", table: "Orders", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AlterColumn( name: "ClientId", table: "EquipmentReceivings", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddForeignKey( name: "FK_EquipmentReceivings_Clients_ClientId", table: "EquipmentReceivings", column: "ClientId", principalTable: "Clients", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_Orders_Clients_ClientId", table: "Orders", column: "ClientId", principalTable: "Clients", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_Supplies_Clients_ClientId", table: "Supplies", column: "ClientId", principalTable: "Clients", principalColumn: "Id"); } } }