using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace WebAPI.Migrations { /// public partial class bookreview2 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Reviews_Books_BookId", table: "Reviews"); migrationBuilder.AlterColumn( name: "BookId", table: "Reviews", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Reviews_Books_BookId", table: "Reviews", column: "BookId", principalTable: "Books", principalColumn: "BookId", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Reviews_Books_BookId", table: "Reviews"); migrationBuilder.AlterColumn( name: "BookId", table: "Reviews", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddForeignKey( name: "FK_Reviews_Books_BookId", table: "Reviews", column: "BookId", principalTable: "Books", principalColumn: "BookId"); } } }