[DB] Update initial db
This commit is contained in:
@@ -32,16 +32,21 @@ public sealed class LibraryDbContext : DbContext
|
||||
{
|
||||
channel.ToTable("channels");
|
||||
channel.HasKey(x => x.Id);
|
||||
//TODO: Link media from channel
|
||||
channel.HasMany(x => x.Media)
|
||||
.WithOne()
|
||||
.HasForeignKey(x => x.ChannelId);
|
||||
channel.HasMany(x => x.Playlists)
|
||||
.WithOne()
|
||||
.HasForeignKey(x => x.ChannelId);
|
||||
channel.HasOne(x => x.ClientAccount)
|
||||
.WithOne()
|
||||
.HasForeignKey<ClientAccountEntity>(e => e.Id);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ClientAccountEntity>(cae =>
|
||||
{
|
||||
cae.ToTable("client_accounts");
|
||||
cae.HasKey(x => x.Id);
|
||||
cae.HasMany(x => x.Playlists)
|
||||
.WithOne()
|
||||
.HasForeignKey(x => x.ChannelId);
|
||||
cae.HasMany(x => x.HttpCookies)
|
||||
.WithOne()
|
||||
.HasForeignKey(x => x.ClientId);
|
||||
|
Reference in New Issue
Block a user