소스 검색

Add device indexes

Patrick Barron 4 년 전
부모
커밋
98e19c9fd3
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      Jellyfin.Server.Implementations/JellyfinDb.cs

+ 7 - 0
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();