fix: remove required from entities' id
also adds "Global" entity for storing global configuration
This commit is contained in:
@@ -17,6 +17,7 @@ public class ApplicationDbContext : DbContext
|
||||
public DbSet<Artist> Artists => Set<Artist>();
|
||||
public DbSet<Genre> Genres => Set<Genre>();
|
||||
public DbSet<GenreSong> GenreSongs => Set<GenreSong>();
|
||||
public DbSet<Global> Globals => Set<Global>();
|
||||
public DbSet<Image> Images => Set<Image>();
|
||||
public DbSet<Playlist> Playlists => Set<Playlist>();
|
||||
public DbSet<PlaylistSong> PlaylistSongs => Set<PlaylistSong>();
|
||||
@@ -52,6 +53,9 @@ public class ApplicationDbContext : DbContext
|
||||
builder.Entity<Genre>(g => {
|
||||
g.HasIndex(g => g.NormalizedName).IsUnique();
|
||||
});
|
||||
builder.Entity<Global>(c => {
|
||||
c.HasIndex(c => c.Key).IsUnique();
|
||||
});
|
||||
builder.Entity<Playlist>(p => {
|
||||
p.HasIndex(p => p.Uri).IsUnique();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user