* add initial models * migrations * edit break content mode * add and remove break content from ui * use autocompletes in deco editor * save break content to db * allow break content playlists * refactor default filler build * fix slow startup * start to implement adding break content * use clone; try to fix block breaks * fix updating history * use consistent removebefore values * cleanup logging * only allow playlist break content * update changelog
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using ErsatzTV.Core.Domain.Scheduling;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace ErsatzTV.Infrastructure.Data.Configurations.Scheduling;
|
|
|
|
public class DecoBreakContentConfiguration : IEntityTypeConfiguration<DecoBreakContent>
|
|
{
|
|
public void Configure(EntityTypeBuilder<DecoBreakContent> builder)
|
|
{
|
|
builder.ToTable("DecoBreakContent");
|
|
|
|
builder.HasOne(i => i.Collection)
|
|
.WithMany()
|
|
.HasForeignKey(i => i.CollectionId)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired(false);
|
|
|
|
builder.HasOne(i => i.MediaItem)
|
|
.WithMany()
|
|
.HasForeignKey(i => i.MediaItemId)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired(false);
|
|
|
|
builder.HasOne(i => i.MultiCollection)
|
|
.WithMany()
|
|
.HasForeignKey(i => i.MultiCollectionId)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired(false);
|
|
|
|
builder.HasOne(i => i.SmartCollection)
|
|
.WithMany()
|
|
.HasForeignKey(i => i.SmartCollectionId)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired(false);
|
|
|
|
builder.HasOne(i => i.Playlist)
|
|
.WithMany()
|
|
.HasForeignKey(i => i.PlaylistId)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired(false);
|
|
}
|
|
}
|