using Microsoft.EntityFrameworkCore.Migrations; namespace ProRestaurant.Migrations { public partial class MenuOptionFKnullabletoCategory : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_MenuOptions_MenuCategories_CategoryId", table: "MenuOptions"); migrationBuilder.AlterColumn( name: "CategoryId", table: "MenuOptions", nullable: true, oldClrType: typeof(int)); migrationBuilder.AddForeignKey( name: "FK_MenuOptions_MenuCategories_CategoryId", table: "MenuOptions", column: "CategoryId", principalTable: "MenuCategories", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_MenuOptions_MenuCategories_CategoryId", table: "MenuOptions"); migrationBuilder.AlterColumn( name: "CategoryId", table: "MenuOptions", nullable: false, oldClrType: typeof(int), oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_MenuOptions_MenuCategories_CategoryId", table: "MenuOptions", column: "CategoryId", principalTable: "MenuCategories", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }