Fix people deduplication lookup (#14864)
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ public class PeopleBaseItemMapConfiguration : IEntityTypeConfiguration<PeopleBas
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<PeopleBaseItemMap> builder)
|
||||
{
|
||||
builder.HasKey(e => new { e.ItemId, e.PeopleId });
|
||||
builder.HasKey(e => new { e.ItemId, e.PeopleId, e.Role });
|
||||
builder.HasIndex(e => new { e.ItemId, e.SortOrder });
|
||||
builder.HasIndex(e => new { e.ItemId, e.ListOrder });
|
||||
builder.HasOne(e => e.Item);
|
||||
|
||||
+1721
File diff suppressed because it is too large
Load Diff
+54
@@ -0,0 +1,54 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jellyfin.Server.Implementations.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ExtendPeopleMapKey : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_PeopleBaseItemMap",
|
||||
table: "PeopleBaseItemMap");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Role",
|
||||
table: "PeopleBaseItemMap",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: string.Empty,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "TEXT",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_PeopleBaseItemMap",
|
||||
table: "PeopleBaseItemMap",
|
||||
columns: new[] { "ItemId", "PeopleId", "Role" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_PeopleBaseItemMap",
|
||||
table: "PeopleBaseItemMap");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Role",
|
||||
table: "PeopleBaseItemMap",
|
||||
type: "TEXT",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "TEXT");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_PeopleBaseItemMap",
|
||||
table: "PeopleBaseItemMap",
|
||||
columns: new[] { "ItemId", "PeopleId" });
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -999,16 +999,16 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||
b.Property<Guid>("PeopleId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("ListOrder")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Role")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("ListOrder")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("SortOrder")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("ItemId", "PeopleId");
|
||||
b.HasKey("ItemId", "PeopleId", "Role");
|
||||
|
||||
b.HasIndex("PeopleId");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user