aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs')
-rw-r--r--Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs
new file mode 100644
index 000000000..abeeb09c9
--- /dev/null
+++ b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs
@@ -0,0 +1,19 @@
+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 ItemValuesConfiguration : IEntityTypeConfiguration<ItemValue>
+{
+ /// <inheritdoc/>
+ public void Configure(EntityTypeBuilder<ItemValue> builder)
+ {
+ builder.HasKey(e => e.ItemValueId);
+ builder.HasIndex(e => new { e.Type, e.CleanValue }).IsUnique();
+ }
+}