[ADD] Simple views for accounts and channels
This commit is contained in:
@@ -58,6 +58,9 @@ public sealed class LibraryDbContext : DbContext
|
||||
.WithOne(x => x.Channel)
|
||||
.HasForeignKey<ClientAccountEntity>(e => e.Id)
|
||||
.IsRequired(false);
|
||||
channel.HasMany(x => x.Files)
|
||||
.WithOne()
|
||||
.HasForeignKey(f => f.ForeignKey);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ClientAccountEntity>(cae =>
|
||||
@@ -71,6 +74,9 @@ public sealed class LibraryDbContext : DbContext
|
||||
.WithOne(ca => ca.ClientAccount)
|
||||
.HasForeignKey<ChannelEntity>(ce => ce.Id)
|
||||
.IsRequired(false);
|
||||
cae.HasMany(x => x.Files)
|
||||
.WithOne()
|
||||
.HasForeignKey(f => f.ForeignKey);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<HttpCookieEntity>(httpce =>
|
||||
|
||||
@@ -17,4 +17,5 @@ public class ChannelEntity : DateTimeBase
|
||||
public List<MediaEntity> Media { get; set; } = [];
|
||||
public List<PlaylistEntity> Playlists { get; set; } = [];
|
||||
public ClientAccountEntity? ClientAccount { get; set; }
|
||||
public List<FileEntity>? Files { get; set; }
|
||||
}
|
||||
@@ -12,4 +12,5 @@ public class ClientAccountEntity : DateTimeBase
|
||||
[MaxLength(DataConstants.DbContext.DefaultDbStringSize)]
|
||||
public string? UserAgent { get; set; }
|
||||
public ChannelEntity? Channel { get; set; }
|
||||
public List<FileEntity>? Files { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user