Add broadcast scheduling features: implement Show and Channel entities, enhance AppDbContext and DependencyInjection for broadcasting, and update API routing. Include migration for new database schema and update documentation for broadcast-related functionalities.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using TeleWave.Domain.Library;
|
||||
|
||||
namespace TeleWave.Infrastructure.Persistence.Configurations;
|
||||
|
||||
public class ShowConfiguration : IEntityTypeConfiguration<Show>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Show> builder)
|
||||
{
|
||||
builder.Property(x => x.Name).IsRequired().HasMaxLength(256);
|
||||
builder.Property(x => x.Description).HasMaxLength(2048);
|
||||
|
||||
builder
|
||||
.HasMany(x => x.Episodes)
|
||||
.WithOne()
|
||||
.HasForeignKey(e => e.ShowId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
builder.Navigation(x => x.Episodes).UsePropertyAccessMode(PropertyAccessMode.Field);
|
||||
}
|
||||
}
|
||||
|
||||
public class ShowEpisodeConfiguration : IEntityTypeConfiguration<ShowEpisode>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ShowEpisode> builder)
|
||||
{
|
||||
builder.HasIndex(x => new { x.ShowId, x.Position });
|
||||
builder.HasIndex(x => x.MediaAssetId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user