first commit
This commit is contained in:
37
BookHive/Migrations/20260309132259_AddedContraint.cs
Normal file
37
BookHive/Migrations/20260309132259_AddedContraint.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BookHive.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddedContraint : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Reviews_BookId",
|
||||
table: "Reviews");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Reviews_BookId_MemberId",
|
||||
table: "Reviews",
|
||||
columns: new[] { "BookId", "MemberId" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Reviews_BookId_MemberId",
|
||||
table: "Reviews");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Reviews_BookId",
|
||||
table: "Reviews",
|
||||
column: "BookId");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user