diff options
Diffstat (limited to 'Jellyfin.Server.Implementations/ModelConfiguration')
3 files changed, 24 insertions, 2 deletions
diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs index 0e90b8d82..fe5cf30ac 100644 --- a/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs +++ b/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs @@ -15,5 +15,7 @@ public class AncestorIdConfiguration : IEntityTypeConfiguration<AncestorId> { builder.HasKey(e => new { e.ItemId, e.ParentItemId }); builder.HasIndex(e => e.ParentItemId); + builder.HasOne(e => e.ParentItem); + builder.HasOne(e => e.Item); } } diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs index c39854f5a..7dfa2032e 100644 --- a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs +++ b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs @@ -13,7 +13,7 @@ public class ItemValuesConfiguration : IEntityTypeConfiguration<ItemValue> /// <inheritdoc/> public void Configure(EntityTypeBuilder<ItemValue> builder) { - builder.HasKey(e => new { e.ItemId, e.Type, e.Value }); - builder.HasIndex(e => new { e.ItemId, e.Type, e.CleanValue }); + builder.HasKey(e => e.ItemValueId); + builder.HasIndex(e => new { e.Type, e.CleanValue }); } } diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesMapConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesMapConfiguration.cs new file mode 100644 index 000000000..9c22b114c --- /dev/null +++ b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesMapConfiguration.cs @@ -0,0 +1,20 @@ +using System; +using Jellyfin.Data.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace Jellyfin.Server.Implementations.ModelConfiguration; + +/// <summary> +/// itemvalues Configuration. +/// </summary> +public class ItemValuesMapConfiguration : IEntityTypeConfiguration<ItemValueMap> +{ + /// <inheritdoc/> + public void Configure(EntityTypeBuilder<ItemValueMap> builder) + { + builder.HasKey(e => new { e.ItemValueId, e.ItemId }); + builder.HasOne(e => e.Item); + builder.HasOne(e => e.ItemValue); + } +} |
