aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/JellyfinDb.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2021-04-10 16:16:08 -0400
committerPatrick Barron <barronpm@gmail.com>2021-04-10 16:16:08 -0400
commit98e19c9fd34c831cce445a5d4aa0a7f277f16237 (patch)
tree48e66b34db49902d7264f482ad59f19b8273fab1 /Jellyfin.Server.Implementations/JellyfinDb.cs
parente6f1ffdc8d2d430cbe4ac1d797e455950bb79ed3 (diff)
Add device indexes
Diffstat (limited to 'Jellyfin.Server.Implementations/JellyfinDb.cs')
-rw-r--r--Jellyfin.Server.Implementations/JellyfinDb.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/JellyfinDb.cs b/Jellyfin.Server.Implementations/JellyfinDb.cs
index 32a857047..059e884e5 100644
--- a/Jellyfin.Server.Implementations/JellyfinDb.cs
+++ b/Jellyfin.Server.Implementations/JellyfinDb.cs
@@ -211,6 +211,13 @@ namespace Jellyfin.Server.Implementations
.HasIndex(entity => entity.Username)
.IsUnique();
+ modelBuilder.Entity<Device>()
+ .HasIndex(entity => new { entity.DeviceId, entity.DateLastActivity });
+
+ modelBuilder.Entity<DeviceOptions>()
+ .HasIndex(entity => entity.DeviceId)
+ .IsUnique();
+
modelBuilder.Entity<DisplayPreferences>()
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
.IsUnique();