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