relation test (collection)
This commit is contained in:
59
BlazorApp/WebAPI/Migrations/20230828043008_book-review2.cs
Normal file
59
BlazorApp/WebAPI/Migrations/20230828043008_book-review2.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WebAPI.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class bookreview2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Reviews_Books_BookId",
|
||||
table: "Reviews");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Reviews_Books_BookId",
|
||||
table: "Reviews");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user