Delete unnecessary indexes

Multicolumn indexes can be queried on the first column without needing a separate index
This commit is contained in:
Patrick Barron 2021-03-17 19:21:03 -04:00
parent 36669ff451
commit 3ffef5794e

View File

@ -149,18 +149,10 @@ namespace Jellyfin.Server.Implementations
modelBuilder.HasDefaultSchema("jellyfin");
modelBuilder.Entity<DisplayPreferences>()
.HasIndex(entity => entity.UserId)
.IsUnique(false);
modelBuilder.Entity<DisplayPreferences>()
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
.IsUnique();
modelBuilder.Entity<CustomItemDisplayPreferences>()
.HasIndex(entity => entity.UserId)
.IsUnique(false);
modelBuilder.Entity<CustomItemDisplayPreferences>()
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client, entity.Key })
.IsUnique();