mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Use NOCASE collation and index on username field
This commit is contained in:
parent
3c4187e780
commit
a07ad71222
@ -149,6 +149,14 @@ namespace Jellyfin.Server.Implementations
|
|||||||
|
|
||||||
modelBuilder.HasDefaultSchema("jellyfin");
|
modelBuilder.HasDefaultSchema("jellyfin");
|
||||||
|
|
||||||
|
// Collations
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.Property(user => user.Username)
|
||||||
|
.UseCollation("NOCASE");
|
||||||
|
|
||||||
|
// Delete behavior
|
||||||
|
|
||||||
modelBuilder.Entity<User>()
|
modelBuilder.Entity<User>()
|
||||||
.HasOne(u => u.ProfileImage)
|
.HasOne(u => u.ProfileImage)
|
||||||
.WithOne()
|
.WithOne()
|
||||||
@ -174,6 +182,11 @@ namespace Jellyfin.Server.Implementations
|
|||||||
.WithOne()
|
.WithOne()
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
// Indexes
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>()
|
||||||
|
.HasIndex(entity => entity.Username)
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
modelBuilder.Entity<DisplayPreferences>()
|
modelBuilder.Entity<DisplayPreferences>()
|
||||||
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
|
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user