aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-11-08 10:38:08 +0100
committercvium <clausvium@gmail.com>2021-11-08 10:38:08 +0100
commitf03e77a4d5fa0ca81ecb11f0ffc4c14706a6dd7d (patch)
tree06ae22d6e13ac26ab9dcb97e54591ad55654d3e1 /Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs
parent153e9202397f236a4a415bd033c3b398b6e6573c (diff)
parent83859a1e6d96cbb60a3b43f7537c0ab0fbdff510 (diff)
Merge branch 'master' into TVFix
Diffstat (limited to 'Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs')
-rw-r--r--Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs
new file mode 100644
index 000000000..038afd752
--- /dev/null
+++ b/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs
@@ -0,0 +1,20 @@
+using Jellyfin.Data.Entities.Security;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace Jellyfin.Server.Implementations.ModelConfiguration
+{
+ /// <summary>
+ /// FluentAPI configuration for the DeviceOptions entity.
+ /// </summary>
+ public class DeviceOptionsConfiguration : IEntityTypeConfiguration<DeviceOptions>
+ {
+ /// <inheritdoc/>
+ public void Configure(EntityTypeBuilder<DeviceOptions> builder)
+ {
+ builder
+ .HasIndex(entity => entity.DeviceId)
+ .IsUnique();
+ }
+ }
+}