using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace EveryThing.Migrations { public partial class _4 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_InvoiceItems_ProjectPartItems_IdProjectPartItem", table: "InvoiceItems"); migrationBuilder.AlterColumn( name: "IdProjectPartItem", table: "InvoiceItems", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddForeignKey( name: "FK_InvoiceItems_ProjectPartItems_IdProjectPartItem", table: "InvoiceItems", column: "IdProjectPartItem", principalTable: "ProjectPartItems", principalColumn: "IdProjectPartItem"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_InvoiceItems_ProjectPartItems_IdProjectPartItem", table: "InvoiceItems"); migrationBuilder.AlterColumn( name: "IdProjectPartItem", table: "InvoiceItems", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_InvoiceItems_ProjectPartItems_IdProjectPartItem", table: "InvoiceItems", column: "IdProjectPartItem", principalTable: "ProjectPartItems", principalColumn: "IdProjectPartItem", onDelete: ReferentialAction.Cascade); } } }