The Free Software Media System - Server Backend & API
Use NOCASE collation and index on username field
Patrick Barrona07ad7122281
diff --git a/Jellyfin.Server.Implementations/JellyfinDb.cs b/Jellyfin.Server.Implementations/JellyfinDb.csindex a2eaea3cac..2ee6f625f8 100644--- a/Jellyfin.Server.Implementations/JellyfinDb.cs+++ b/Jellyfin.Server.Implementations/JellyfinDb.cs@@ -149,6 +149,14 @@ namespace Jellyfin.Server.ImplementationsmodelBuilder.HasDefaultSchema("jellyfin");+ // Collations++ modelBuilder.Entity<User>()+ .Property(user => user.Username)+ .UseCollation("NOCASE");++ // Delete behavior+modelBuilder.Entity<User>().HasOne(u => u.ProfileImage).WithOne()@@ -174,6 +182,11 @@ namespace Jellyfin.Server.Implementations.WithOne().OnDelete(DeleteBehavior.Cascade);+ // Indexes++ modelBuilder.Entity<User>()+ .HasIndex(entity => entity.Username)+ .IsUnique();modelBuilder.Entity<DisplayPreferences>().HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })