Fixed Duplicate returns on grouping

Fixed UserDataKey not stored
This commit is contained in:
JPVenson
2024-11-11 17:39:50 +00:00
parent bdab5e549e
commit 508b27f156
11 changed files with 3391 additions and 34 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jellyfin.Server.Implementations.Migrations
{
/// <inheritdoc />
public partial class AddedCustomDataKey : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CustomDataKey",
table: "UserData",
type: "TEXT",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CustomDataKey",
table: "UserData");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jellyfin.Server.Implementations.Migrations
{
/// <inheritdoc />
public partial class AddedCustomDataKeyKey : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_UserData",
table: "UserData");
migrationBuilder.AlterColumn<string>(
name: "CustomDataKey",
table: "UserData",
type: "TEXT",
nullable: false,
defaultValue: string.Empty,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_UserData",
table: "UserData",
columns: new[] { "ItemId", "UserId", "CustomDataKey" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_UserData",
table: "UserData");
migrationBuilder.AlterColumn<string>(
name: "CustomDataKey",
table: "UserData",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AddPrimaryKey(
name: "PK_UserData",
table: "UserData",
columns: new[] { "ItemId", "UserId" });
}
}
}

View File

@@ -1276,6 +1276,9 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<string>("CustomDataKey")
.HasColumnType("TEXT");
b.Property<int?>("AudioStreamIndex")
.HasColumnType("INTEGER");
@@ -1303,7 +1306,7 @@ namespace Jellyfin.Server.Implementations.Migrations
b.Property<int?>("SubtitleStreamIndex")
.HasColumnType("INTEGER");
b.HasKey("ItemId", "UserId");
b.HasKey("ItemId", "UserId", "CustomDataKey");
b.HasIndex("UserId");