@@ -155,7 +155,7 @@ namespace Jellyfin.Server.Implementations
base.OnModelCreating(modelBuilder);
modelBuilder.HasDefaultSchema("jellyfin");
- // Configuration for each entity is in it's own class inside 'ModelConfiguratio'.
+ // Configuration for each entity is in it's own class inside 'ModelConfiguration'.
modelBuilder.ApplyConfigurationsFromAssembly(typeof(JellyfinDb).Assembly);
}
@@ -12,8 +12,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
/// <inheritdoc/>
public void Configure(EntityTypeBuilder<ApiKey> builder)
{
- // Indexes
-
builder
.HasIndex(entity => entity.AccessToken)
.IsUnique();
public void Configure(EntityTypeBuilder<CustomItemDisplayPreferences> builder)
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client, entity.Key })
public void Configure(EntityTypeBuilder<Device> builder)
.HasIndex(entity => new { entity.DeviceId, entity.DateLastActivity });
public void Configure(EntityTypeBuilder<DeviceOptions> builder)
.HasIndex(entity => entity.DeviceId)
@@ -12,15 +12,11 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
public void Configure(EntityTypeBuilder<DisplayPreferences> builder)
- // Delete behaviour
.HasMany(d => d.HomeSections)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
.HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client })
public void Configure(EntityTypeBuilder<Permission> builder)
// Used to get a user's permissions or a specific permission for a user.
// Also prevents multiple values being created for a user.
// Filtered over non-null user ids for when other entities (groups, API keys) get permissions
public void Configure(EntityTypeBuilder<Preference> builder)
.HasIndex(p => new { p.UserId, p.Kind })
.HasFilter("[UserId] IS NOT NULL")
@@ -12,14 +12,10 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
public void Configure(EntityTypeBuilder<User> builder)
- // Collations
.Property(user => user.Username)
.UseCollation("NOCASE");
- // Delete behavior
.HasOne(u => u.ProfileImage)
@@ -52,8 +48,6 @@ namespace Jellyfin.Server.Implementations.ModelConfiguration
.HasIndex(entity => entity.Username)