using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace API.Migrations { /// public partial class PreferedRecipesisnullable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Users_PrefereredRecipes_PrefereredRecipesId", table: "Users"); migrationBuilder.AlterColumn( name: "PrefereredRecipesId", table: "Users", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddForeignKey( name: "FK_Users_PrefereredRecipes_PrefereredRecipesId", table: "Users", column: "PrefereredRecipesId", principalTable: "PrefereredRecipes", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Users_PrefereredRecipes_PrefereredRecipesId", table: "Users"); migrationBuilder.AlterColumn( name: "PrefereredRecipesId", table: "Users", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Users_PrefereredRecipes_PrefereredRecipesId", table: "Users", column: "PrefereredRecipesId", principalTable: "PrefereredRecipes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }