#221 removing bookmarks verse id dependency
This commit is contained in:
parent
9c0f55b5ba
commit
290b8fa212
3224
RMuseum/Migrations/20211013162354_GanjoorUserBookmark-RemoveVerseIdDep.Designer.cs
generated
Normal file
3224
RMuseum/Migrations/20211013162354_GanjoorUserBookmark-RemoveVerseIdDep.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
public partial class GanjoorUserBookmarkRemoveVerseIdDep : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_VerseId",
|
||||
table: "GanjoorUserBookmarks");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "VerseId",
|
||||
table: "GanjoorUserBookmarks",
|
||||
type: "int",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_VerseId",
|
||||
table: "GanjoorUserBookmarks",
|
||||
columns: new[] { "UserId", "PoemId", "VerseId" },
|
||||
unique: true,
|
||||
filter: "[VerseId] IS NOT NULL");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_VerseId",
|
||||
table: "GanjoorUserBookmarks");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "VerseId",
|
||||
table: "GanjoorUserBookmarks",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_VerseId",
|
||||
table: "GanjoorUserBookmarks",
|
||||
columns: new[] { "UserId", "PoemId", "VerseId" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1039,7 +1039,7 @@ namespace RMuseum.Migrations
|
||||
b.Property<int?>("Verse2Id")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("VerseId")
|
||||
b.Property<int?>("VerseId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
@ -1051,7 +1051,8 @@ namespace RMuseum.Migrations
|
||||
b.HasIndex("VerseId");
|
||||
|
||||
b.HasIndex("UserId", "PoemId", "VerseId")
|
||||
.IsUnique();
|
||||
.IsUnique()
|
||||
.HasFilter("[VerseId] IS NOT NULL");
|
||||
|
||||
b.ToTable("GanjoorUserBookmarks");
|
||||
});
|
||||
@ -2779,8 +2780,7 @@ namespace RMuseum.Migrations
|
||||
b.HasOne("RMuseum.Models.Ganjoor.GanjoorVerse", "Verse")
|
||||
.WithMany()
|
||||
.HasForeignKey("VerseId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("Poem");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user