#221 fixing indexes
This commit is contained in:
parent
77f56add0e
commit
218f122edc
@ -121,8 +121,7 @@ namespace RMuseum.DbContext
|
||||
.IsUnique();
|
||||
|
||||
builder.Entity<GanjoorUserBookmark>()
|
||||
.HasIndex(b => new { b.UserId, b.PoemId, b.VerseId })
|
||||
.IsUnique();
|
||||
.HasIndex(b => new { b.UserId, b.PoemId, b.CoupletIndex });
|
||||
|
||||
builder.Entity<GanjoorVerseNumber>()
|
||||
.HasIndex(n => new { n.NumberingId, n.PoemId, n.CoupletIndex })
|
||||
|
||||
3205
RMuseum/Migrations/20211013164253_GanjoorUserBookmark-CoupletIndex.Designer.cs
generated
Normal file
3205
RMuseum/Migrations/20211013164253_GanjoorUserBookmark-CoupletIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
public partial class GanjoorUserBookmarkCoupletIndex : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_VerseId",
|
||||
table: "GanjoorUserBookmarks");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_CoupletIndex",
|
||||
table: "GanjoorUserBookmarks",
|
||||
columns: new[] { "UserId", "PoemId", "CoupletIndex" });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_CoupletIndex",
|
||||
table: "GanjoorUserBookmarks");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorUserBookmarks_UserId_PoemId_VerseId",
|
||||
table: "GanjoorUserBookmarks",
|
||||
columns: new[] { "UserId", "PoemId", "VerseId" },
|
||||
unique: true,
|
||||
filter: "[VerseId] IS NOT NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1046,9 +1046,7 @@ namespace RMuseum.Migrations
|
||||
|
||||
b.HasIndex("PoemId");
|
||||
|
||||
b.HasIndex("UserId", "PoemId", "VerseId")
|
||||
.IsUnique()
|
||||
.HasFilter("[VerseId] IS NOT NULL");
|
||||
b.HasIndex("UserId", "PoemId", "CoupletIndex");
|
||||
|
||||
b.ToTable("GanjoorUserBookmarks");
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user