Fix people deduplication lookup (#14864)
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
OpenAPI / OpenAPI - HEAD (push) Has been cancelled
OpenAPI / OpenAPI - BASE (push) Has been cancelled
OpenAPI / OpenAPI - Difference (push) Has been cancelled
OpenAPI / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI / OpenAPI - Publish Stable Spec (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled

This commit is contained in:
JPVenson
2025-09-26 04:27:38 +03:00
committed by GitHub
parent 1736a566cc
commit 54d48fa446
5 changed files with 1786 additions and 6 deletions

View File

@@ -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);

View File

@@ -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" });
}
}
}

View File

@@ -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");