// <auto-generated />
using System;
using ErsatzTV.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace ErsatzTV.Infrastructure.MySql.Migrations
{
    [DbContext(typeof(TvContext))]
    [Migration("20250721130355_Add_RemoteStreamIsLive")]
    partial class Add_RemoteStreamIsLive
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "9.0.7")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);

            modelBuilder.Entity("ErsatzTV.Core.Domain.Actor", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ArtworkId")
                        .HasColumnType("int");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("Order")
                        .HasColumnType("int");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Role")
                        .HasColumnType("longtext");

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("ArtworkId")
                        .IsUnique();

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("Actor", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ArtistMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("ArtistId")
                        .HasColumnType("int");

                    b.Property<string>("Biography")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Disambiguation")
                        .HasColumnType("longtext");

                    b.Property<string>("Formed")
                        .HasColumnType("longtext");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ArtistId");

                    b.ToTable("ArtistMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Artwork", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<int>("ArtworkKind")
                        .HasColumnType("int");

                    b.Property<string>("BlurHash43")
                        .HasColumnType("longtext");

                    b.Property<string>("BlurHash54")
                        .HasColumnType("longtext");

                    b.Property<string>("BlurHash64")
                        .HasColumnType("longtext");

                    b.Property<int?>("ChannelId")
                        .HasColumnType("int");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("OriginalContentType")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Path")
                        .HasColumnType("longtext");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("SourcePath")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("ChannelId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("Artwork", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("ActiveMode")
                        .HasColumnType("int");

                    b.Property<string>("Categories")
                        .HasColumnType("longtext");

                    b.Property<int>("FFmpegProfileId")
                        .HasColumnType("int");

                    b.Property<int?>("FallbackFillerId")
                        .HasColumnType("int");

                    b.Property<string>("Group")
                        .IsRequired()
                        .ValueGeneratedOnAdd()
                        .HasColumnType("longtext")
                        .HasDefaultValue("ErsatzTV");

                    b.Property<int>("MusicVideoCreditsMode")
                        .HasColumnType("int");

                    b.Property<string>("MusicVideoCreditsTemplate")
                        .HasColumnType("longtext");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<string>("Number")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("PreferredAudioLanguageCode")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredAudioTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredSubtitleLanguageCode")
                        .HasColumnType("longtext");

                    b.Property<int>("ProgressMode")
                        .HasColumnType("int");

                    b.Property<int>("SongVideoMode")
                        .HasColumnType("int");

                    b.Property<string>("StreamSelector")
                        .HasColumnType("longtext");

                    b.Property<int>("StreamSelectorMode")
                        .HasColumnType("int");

                    b.Property<int>("StreamingMode")
                        .HasColumnType("int");

                    b.Property<int>("SubtitleMode")
                        .HasColumnType("int");

                    b.Property<Guid>("UniqueId")
                        .HasColumnType("char(36)");

                    b.Property<int?>("WatermarkId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("FFmpegProfileId");

                    b.HasIndex("FallbackFillerId");

                    b.HasIndex("Number")
                        .IsUnique();

                    b.HasIndex("WatermarkId");

                    b.ToTable("Channel", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ChannelWatermark", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("DurationSeconds")
                        .HasColumnType("int");

                    b.Property<int>("FrequencyMinutes")
                        .HasColumnType("int");

                    b.Property<double>("HorizontalMarginPercent")
                        .HasColumnType("double");

                    b.Property<string>("Image")
                        .HasColumnType("longtext");

                    b.Property<int>("ImageSource")
                        .HasColumnType("int");

                    b.Property<int>("Location")
                        .HasColumnType("int");

                    b.Property<int>("Mode")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int>("Opacity")
                        .HasColumnType("int");

                    b.Property<string>("OriginalContentType")
                        .HasColumnType("longtext");

                    b.Property<bool>("PlaceWithinSourceContent")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("Size")
                        .HasColumnType("int");

                    b.Property<double>("VerticalMarginPercent")
                        .HasColumnType("double");

                    b.Property<double>("WidthPercent")
                        .HasColumnType("double");

                    b.HasKey("Id");

                    b.ToTable("ChannelWatermark", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<bool>("UseCustomPlaybackOrder")
                        .HasColumnType("tinyint(1)");

                    b.HasKey("Id");

                    b.ToTable("Collection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.CollectionItem", b =>
                {
                    b.Property<int>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int?>("CustomIndex")
                        .HasColumnType("int");

                    b.HasKey("CollectionId", "MediaItemId");

                    b.HasIndex("MediaItemId");

                    b.ToTable("CollectionItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ConfigElement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Key")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("Value")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("Key")
                        .IsUnique();

                    b.ToTable("ConfigElement", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Director", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.ToTable("Director", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyCollection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("EmbyCollection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyConnection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Address")
                        .HasColumnType("longtext");

                    b.Property<int>("EmbyMediaSourceId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("EmbyMediaSourceId");

                    b.ToTable("EmbyConnection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyPathReplacement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("EmbyMediaSourceId")
                        .HasColumnType("int");

                    b.Property<string>("EmbyPath")
                        .HasColumnType("longtext");

                    b.Property<string>("LocalPath")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("EmbyMediaSourceId");

                    b.ToTable("EmbyPathReplacement", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("EpisodeId")
                        .HasColumnType("int");

                    b.Property<int>("EpisodeNumber")
                        .HasColumnType("int");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Outline")
                        .HasColumnType("longtext");

                    b.Property<string>("Plot")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Tagline")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("EpisodeId");

                    b.ToTable("EpisodeMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AllowBFrames")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("AudioBitrate")
                        .HasColumnType("int");

                    b.Property<int>("AudioBufferSize")
                        .HasColumnType("int");

                    b.Property<int>("AudioChannels")
                        .HasColumnType("int");

                    b.Property<int>("AudioFormat")
                        .HasColumnType("int");

                    b.Property<int>("AudioSampleRate")
                        .HasColumnType("int");

                    b.Property<int>("BitDepth")
                        .HasColumnType("int");

                    b.Property<bool?>("DeinterlaceVideo")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(true);

                    b.Property<int>("HardwareAcceleration")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<bool>("NormalizeFramerate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.Property<int>("NormalizeLoudnessMode")
                        .HasColumnType("int");

                    b.Property<int?>("QsvExtraHardwareFrames")
                        .HasColumnType("int");

                    b.Property<int>("ResolutionId")
                        .HasColumnType("int");

                    b.Property<int>("ScalingBehavior")
                        .HasColumnType("int");

                    b.Property<int>("ThreadCount")
                        .HasColumnType("int");

                    b.Property<int>("TonemapAlgorithm")
                        .HasColumnType("int");

                    b.Property<string>("VaapiDevice")
                        .HasColumnType("longtext");

                    b.Property<string>("VaapiDisplay")
                        .HasColumnType("longtext");

                    b.Property<int>("VaapiDriver")
                        .HasColumnType("int");

                    b.Property<int>("VideoBitrate")
                        .HasColumnType("int");

                    b.Property<int>("VideoBufferSize")
                        .HasColumnType("int");

                    b.Property<int>("VideoFormat")
                        .HasColumnType("int");

                    b.Property<string>("VideoPreset")
                        .HasColumnType("longtext");

                    b.Property<string>("VideoProfile")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ResolutionId");

                    b.ToTable("FFmpegProfile", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Filler.FillerPreset", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AllowWatermarks")
                        .HasColumnType("tinyint(1)");

                    b.Property<int?>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("CollectionType")
                        .HasColumnType("int");

                    b.Property<int?>("Count")
                        .HasColumnType("int");

                    b.Property<TimeSpan?>("Duration")
                        .HasColumnType("time(6)");

                    b.Property<string>("Expression")
                        .HasColumnType("longtext");

                    b.Property<int>("FillerKind")
                        .HasColumnType("int");

                    b.Property<int>("FillerMode")
                        .HasColumnType("int");

                    b.Property<int?>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int?>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("PadToNearestMinute")
                        .HasColumnType("int");

                    b.Property<int?>("SmartCollectionId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CollectionId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("SmartCollectionId");

                    b.ToTable("FillerPreset", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Genre", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("Genre");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ImageFolderDuration", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<double>("DurationSeconds")
                        .HasColumnType("double");

                    b.Property<int>("LibraryFolderId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("LibraryFolderId")
                        .IsUnique();

                    b.ToTable("ImageFolderDuration", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ImageMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<double?>("DurationSeconds")
                        .HasColumnType("double");

                    b.Property<int>("ImageId")
                        .HasColumnType("int");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ImageId");

                    b.ToTable("ImageMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinCollection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("JellyfinCollection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinConnection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Address")
                        .HasColumnType("longtext");

                    b.Property<int>("JellyfinMediaSourceId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("JellyfinMediaSourceId");

                    b.ToTable("JellyfinConnection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinPathReplacement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("JellyfinMediaSourceId")
                        .HasColumnType("int");

                    b.Property<string>("JellyfinPath")
                        .HasColumnType("longtext");

                    b.Property<string>("LocalPath")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("JellyfinMediaSourceId");

                    b.ToTable("JellyfinPathReplacement", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LanguageCode", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("EnglishName")
                        .HasColumnType("longtext");

                    b.Property<string>("FrenchName")
                        .HasColumnType("longtext");

                    b.Property<string>("ThreeCode1")
                        .HasColumnType("longtext");

                    b.Property<string>("ThreeCode2")
                        .HasColumnType("longtext");

                    b.Property<string>("TwoCode")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("LanguageCode", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime?>("LastScan")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MediaKind")
                        .HasColumnType("int");

                    b.Property<int>("MediaSourceId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("MediaSourceId");

                    b.ToTable("Library", (string)null);

                    b.UseTptMappingStrategy();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryFolder", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<int>("LibraryPathId")
                        .HasColumnType("int");

                    b.Property<int?>("ParentId")
                        .HasColumnType("int");

                    b.Property<string>("Path")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("LibraryPathId");

                    b.HasIndex("ParentId");

                    b.ToTable("LibraryFolder", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime?>("LastScan")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("LibraryId")
                        .HasColumnType("int");

                    b.Property<string>("Path")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("LibraryId");

                    b.ToTable("LibraryPath", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaChapter", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<long>("ChapterId")
                        .HasColumnType("bigint");

                    b.Property<TimeSpan>("EndTime")
                        .HasColumnType("time(6)");

                    b.Property<int>("MediaVersionId")
                        .HasColumnType("int");

                    b.Property<TimeSpan>("StartTime")
                        .HasColumnType("time(6)");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("MediaVersionId");

                    b.ToTable("MediaChapter", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaFile", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("LibraryFolderId")
                        .HasColumnType("int");

                    b.Property<int>("MediaVersionId")
                        .HasColumnType("int");

                    b.Property<string>("Path")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("LibraryFolderId");

                    b.HasIndex("MediaVersionId");

                    b.HasIndex("Path")
                        .IsUnique();

                    b.ToTable("MediaFile", (string)null);

                    b.UseTptMappingStrategy();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("LibraryPathId")
                        .HasColumnType("int");

                    b.Property<int>("State")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("LibraryPathId");

                    b.ToTable("MediaItem", (string)null);

                    b.UseTptMappingStrategy();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.HasKey("Id");

                    b.ToTable("MediaSource", (string)null);

                    b.UseTptMappingStrategy();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaStream", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AttachedPic")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("BitsPerRawSample")
                        .HasColumnType("int");

                    b.Property<int>("Channels")
                        .HasColumnType("int");

                    b.Property<string>("Codec")
                        .HasColumnType("longtext");

                    b.Property<string>("ColorPrimaries")
                        .HasColumnType("longtext");

                    b.Property<string>("ColorRange")
                        .HasColumnType("longtext");

                    b.Property<string>("ColorSpace")
                        .HasColumnType("longtext");

                    b.Property<string>("ColorTransfer")
                        .HasColumnType("longtext");

                    b.Property<bool>("Default")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("FileName")
                        .HasColumnType("longtext");

                    b.Property<bool>("Forced")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<string>("Language")
                        .HasColumnType("longtext");

                    b.Property<int>("MediaStreamKind")
                        .HasColumnType("int");

                    b.Property<int>("MediaVersionId")
                        .HasColumnType("int");

                    b.Property<string>("MimeType")
                        .HasColumnType("longtext");

                    b.Property<string>("PixelFormat")
                        .HasColumnType("longtext");

                    b.Property<string>("Profile")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("MediaVersionId");

                    b.ToTable("MediaStream", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DisplayAspectRatio")
                        .HasColumnType("longtext");

                    b.Property<TimeSpan>("Duration")
                        .HasColumnType("time(6)");

                    b.Property<int?>("EpisodeId")
                        .HasColumnType("int");

                    b.Property<int>("Height")
                        .HasColumnType("int");

                    b.Property<int?>("ImageId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoId")
                        .HasColumnType("int");

                    b.Property<string>("RFrameRate")
                        .HasColumnType("longtext");

                    b.Property<int?>("RemoteStreamId")
                        .HasColumnType("int");

                    b.Property<string>("SampleAspectRatio")
                        .HasColumnType("longtext");

                    b.Property<int?>("SongId")
                        .HasColumnType("int");

                    b.Property<int>("VideoScanKind")
                        .HasColumnType("int");

                    b.Property<int>("Width")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("EpisodeId");

                    b.HasIndex("ImageId");

                    b.HasIndex("MovieId");

                    b.HasIndex("MusicVideoId");

                    b.HasIndex("OtherVideoId");

                    b.HasIndex("RemoteStreamId");

                    b.HasIndex("SongId");

                    b.ToTable("MediaVersion", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MetadataGuid", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Guid")
                        .HasColumnType("longtext");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("MetadataGuid", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Mood", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.ToTable("Mood");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ContentRating")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<int>("MovieId")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Outline")
                        .HasColumnType("longtext");

                    b.Property<string>("Plot")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Tagline")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("MovieId");

                    b.ToTable("MovieMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MultiCollection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("MultiCollection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MultiCollectionItem", b =>
                {
                    b.Property<int>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("PlaybackOrder")
                        .HasColumnType("int");

                    b.Property<bool>("ScheduleAsGroup")
                        .HasColumnType("tinyint(1)");

                    b.HasKey("MultiCollectionId", "CollectionId");

                    b.HasIndex("CollectionId");

                    b.ToTable("MultiCollectionItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MultiCollectionSmartItem", b =>
                {
                    b.Property<int>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("SmartCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("PlaybackOrder")
                        .HasColumnType("int");

                    b.Property<bool>("ScheduleAsGroup")
                        .HasColumnType("tinyint(1)");

                    b.HasKey("MultiCollectionId", "SmartCollectionId");

                    b.HasIndex("SmartCollectionId");

                    b.ToTable("MultiCollectionSmartItem");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideoArtist", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("MusicVideoMetadataId");

                    b.ToTable("MusicVideoArtist");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideoMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Album")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<int>("MusicVideoId")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Plot")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Track")
                        .HasColumnType("int");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("MusicVideoId");

                    b.ToTable("MusicVideoMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideoMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ContentRating")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<int>("OtherVideoId")
                        .HasColumnType("int");

                    b.Property<string>("Outline")
                        .HasColumnType("longtext");

                    b.Property<string>("Plot")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Tagline")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("OtherVideoId");

                    b.ToTable("OtherVideoMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playlist", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("IsSystem")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<int>("PlaylistGroupId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("PlaylistGroupId", "Name")
                        .IsUnique();

                    b.ToTable("Playlist", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlaylistGroup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("IsSystem")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("PlaylistGroup", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlaylistItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("CollectionType")
                        .HasColumnType("int");

                    b.Property<bool>("IncludeInProgramGuide")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<int?>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int?>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<bool>("PlayAll")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("PlaybackOrder")
                        .HasColumnType("int");

                    b.Property<int>("PlaylistId")
                        .HasColumnType("int");

                    b.Property<int?>("SmartCollectionId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CollectionId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("PlaylistId");

                    b.HasIndex("SmartCollectionId");

                    b.ToTable("PlaylistItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("ChannelId")
                        .HasColumnType("int");

                    b.Property<TimeSpan?>("DailyRebuildTime")
                        .HasColumnType("time(6)");

                    b.Property<int?>("DecoId")
                        .HasColumnType("int");

                    b.Property<string>("ExternalJsonFile")
                        .HasColumnType("longtext");

                    b.Property<DateTimeOffset?>("OnDemandCheckpoint")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("ProgramScheduleId")
                        .HasColumnType("int");

                    b.Property<int>("ProgramSchedulePlayoutType")
                        .HasColumnType("int");

                    b.Property<int>("Seed")
                        .HasColumnType("int");

                    b.Property<string>("TemplateFile")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ChannelId");

                    b.HasIndex("DecoId");

                    b.HasIndex("ProgramScheduleId");

                    b.ToTable("Playout", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("BlockKey")
                        .HasColumnType("longtext");

                    b.Property<string>("ChapterTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("CollectionEtag")
                        .HasColumnType("longtext");

                    b.Property<string>("CollectionKey")
                        .HasColumnType("longtext");

                    b.Property<string>("CustomTitle")
                        .HasColumnType("longtext");

                    b.Property<bool>("DisableWatermarks")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("FillerKind")
                        .HasColumnType("int");

                    b.Property<DateTime>("Finish")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("GuideFinish")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("GuideGroup")
                        .HasColumnType("int");

                    b.Property<DateTime?>("GuideStart")
                        .HasColumnType("datetime(6)");

                    b.Property<TimeSpan>("InPoint")
                        .HasColumnType("time(6)");

                    b.Property<int>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<TimeSpan>("OutPoint")
                        .HasColumnType("time(6)");

                    b.Property<int>("PlayoutId")
                        .HasColumnType("int");

                    b.Property<string>("PreferredAudioLanguageCode")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredAudioTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredSubtitleLanguageCode")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("Start")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("SubtitleMode")
                        .HasColumnType("int");

                    b.Property<int?>("WatermarkId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("PlayoutId");

                    b.HasIndex("WatermarkId");

                    b.ToTable("PlayoutItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime?>("AnchorDate")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("CollectionType")
                        .HasColumnType("int");

                    b.Property<string>("FakeCollectionKey")
                        .HasColumnType("longtext");

                    b.Property<int?>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int?>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int?>("PlaylistId")
                        .HasColumnType("int");

                    b.Property<int>("PlayoutId")
                        .HasColumnType("int");

                    b.Property<int?>("SmartCollectionId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CollectionId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("PlaylistId");

                    b.HasIndex("PlayoutId");

                    b.HasIndex("SmartCollectionId");

                    b.ToTable("PlayoutProgramScheduleAnchor", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutScheduleItemFillGroupIndex", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("PlayoutId")
                        .HasColumnType("int");

                    b.Property<int>("ProgramScheduleItemId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("PlayoutId");

                    b.HasIndex("ProgramScheduleItemId");

                    b.ToTable("PlayoutScheduleItemFillGroupIndex", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexCollection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("PlexCollection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexConnection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("IsActive")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("PlexMediaSourceId")
                        .HasColumnType("int");

                    b.Property<string>("Uri")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("PlexMediaSourceId");

                    b.ToTable("PlexConnection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexPathReplacement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("LocalPath")
                        .HasColumnType("longtext");

                    b.Property<int>("PlexMediaSourceId")
                        .HasColumnType("int");

                    b.Property<string>("PlexPath")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("PlexMediaSourceId");

                    b.ToTable("PlexPathReplacement", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("FixedStartTimeBehavior")
                        .HasColumnType("int");

                    b.Property<bool>("KeepMultiPartEpisodesTogether")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<bool>("RandomStartPoint")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("ShuffleScheduleItems")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("TreatCollectionsAsShows")
                        .HasColumnType("tinyint(1)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("ProgramSchedule", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleAlternate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("DaysOfMonth")
                        .HasColumnType("longtext");

                    b.Property<string>("DaysOfWeek")
                        .HasColumnType("longtext");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<string>("MonthsOfYear")
                        .HasColumnType("longtext");

                    b.Property<int>("PlayoutId")
                        .HasColumnType("int");

                    b.Property<int>("ProgramScheduleId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("PlayoutId");

                    b.HasIndex("ProgramScheduleId");

                    b.ToTable("ProgramScheduleAlternate", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("CollectionType")
                        .HasColumnType("int");

                    b.Property<string>("CustomTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("FakeCollectionKey")
                        .HasColumnType("longtext");

                    b.Property<int?>("FallbackFillerId")
                        .HasColumnType("int");

                    b.Property<int>("FillWithGroupMode")
                        .HasColumnType("int");

                    b.Property<int?>("FixedStartTimeBehavior")
                        .HasColumnType("int");

                    b.Property<int>("GuideMode")
                        .HasColumnType("int");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<int?>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int?>("MidRollFillerId")
                        .HasColumnType("int");

                    b.Property<int?>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("PlaybackOrder")
                        .HasColumnType("int");

                    b.Property<int?>("PlaylistId")
                        .HasColumnType("int");

                    b.Property<int?>("PostRollFillerId")
                        .HasColumnType("int");

                    b.Property<int?>("PreRollFillerId")
                        .HasColumnType("int");

                    b.Property<string>("PreferredAudioLanguageCode")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredAudioTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredSubtitleLanguageCode")
                        .HasColumnType("longtext");

                    b.Property<int>("ProgramScheduleId")
                        .HasColumnType("int");

                    b.Property<int?>("SmartCollectionId")
                        .HasColumnType("int");

                    b.Property<TimeSpan?>("StartTime")
                        .HasColumnType("time(6)");

                    b.Property<int?>("SubtitleMode")
                        .HasColumnType("int");

                    b.Property<int?>("TailFillerId")
                        .HasColumnType("int");

                    b.Property<int?>("WatermarkId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CollectionId");

                    b.HasIndex("FallbackFillerId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MidRollFillerId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("PlaylistId");

                    b.HasIndex("PostRollFillerId");

                    b.HasIndex("PreRollFillerId");

                    b.HasIndex("ProgramScheduleId");

                    b.HasIndex("SmartCollectionId");

                    b.HasIndex("TailFillerId");

                    b.HasIndex("WatermarkId");

                    b.ToTable("ProgramScheduleItem", (string)null);

                    b.UseTptMappingStrategy();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.RemoteStreamMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("RemoteStreamId")
                        .HasColumnType("int");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("RemoteStreamId");

                    b.ToTable("RemoteStreamMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Resolution", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("Height")
                        .HasColumnType("int");

                    b.Property<bool>("IsCustom")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int>("Width")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.ToTable("Resolution", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Block", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("BlockGroupId")
                        .HasColumnType("int");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Minutes")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<int>("StopScheduling")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("BlockGroupId", "Name")
                        .IsUnique();

                    b.ToTable("Block", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.BlockGroup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("BlockGroup", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.BlockItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("BlockId")
                        .HasColumnType("int");

                    b.Property<int?>("CollectionId")
                        .HasColumnType("int");

                    b.Property<int>("CollectionType")
                        .HasColumnType("int");

                    b.Property<bool>("DisableWatermarks")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IncludeInProgramGuide")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<int?>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int?>("MultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("PlaybackOrder")
                        .HasColumnType("int");

                    b.Property<int?>("SmartCollectionId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("BlockId");

                    b.HasIndex("CollectionId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("SmartCollectionId");

                    b.ToTable("BlockItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Deco", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("DeadAirFallbackCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("DeadAirFallbackCollectionType")
                        .HasColumnType("int");

                    b.Property<int?>("DeadAirFallbackMediaItemId")
                        .HasColumnType("int");

                    b.Property<int>("DeadAirFallbackMode")
                        .HasColumnType("int");

                    b.Property<int?>("DeadAirFallbackMultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int?>("DeadAirFallbackSmartCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("DecoGroupId")
                        .HasColumnType("int");

                    b.Property<int?>("DefaultFillerCollectionId")
                        .HasColumnType("int");

                    b.Property<int>("DefaultFillerCollectionType")
                        .HasColumnType("int");

                    b.Property<int?>("DefaultFillerMediaItemId")
                        .HasColumnType("int");

                    b.Property<int>("DefaultFillerMode")
                        .HasColumnType("int");

                    b.Property<int?>("DefaultFillerMultiCollectionId")
                        .HasColumnType("int");

                    b.Property<int?>("DefaultFillerSmartCollectionId")
                        .HasColumnType("int");

                    b.Property<bool>("DefaultFillerTrimToFit")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<bool>("UseWatermarkDuringFiller")
                        .HasColumnType("tinyint(1)");

                    b.Property<int?>("WatermarkId")
                        .HasColumnType("int");

                    b.Property<int>("WatermarkMode")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DeadAirFallbackCollectionId");

                    b.HasIndex("DeadAirFallbackMediaItemId");

                    b.HasIndex("DeadAirFallbackMultiCollectionId");

                    b.HasIndex("DeadAirFallbackSmartCollectionId");

                    b.HasIndex("DefaultFillerCollectionId");

                    b.HasIndex("DefaultFillerMediaItemId");

                    b.HasIndex("DefaultFillerMultiCollectionId");

                    b.HasIndex("DefaultFillerSmartCollectionId");

                    b.HasIndex("WatermarkId");

                    b.HasIndex("DecoGroupId", "Name")
                        .IsUnique();

                    b.ToTable("Deco", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoGroup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("DecoGroup", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("DecoTemplateGroupId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("DecoTemplateGroupId");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("DecoTemplate", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplateGroup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("DecoTemplateGroup", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplateItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("DecoId")
                        .HasColumnType("int");

                    b.Property<int>("DecoTemplateId")
                        .HasColumnType("int");

                    b.Property<TimeSpan>("EndTime")
                        .HasColumnType("time(6)");

                    b.Property<TimeSpan>("StartTime")
                        .HasColumnType("time(6)");

                    b.HasKey("Id");

                    b.HasIndex("DecoId");

                    b.HasIndex("DecoTemplateId");

                    b.ToTable("DecoTemplateItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.PlayoutHistory", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("BlockId")
                        .HasColumnType("int");

                    b.Property<string>("ChildKey")
                        .HasColumnType("longtext");

                    b.Property<string>("Details")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("Finish")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<bool>("IsCurrentChild")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.Property<int>("PlaybackOrder")
                        .HasColumnType("int");

                    b.Property<int>("PlayoutId")
                        .HasColumnType("int");

                    b.Property<DateTime>("When")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("BlockId");

                    b.HasIndex("PlayoutId");

                    b.ToTable("PlayoutHistory", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.PlayoutTemplate", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DaysOfMonth")
                        .HasColumnType("longtext");

                    b.Property<string>("DaysOfWeek")
                        .HasColumnType("longtext");

                    b.Property<int?>("DecoTemplateId")
                        .HasColumnType("int");

                    b.Property<int>("EndDay")
                        .HasColumnType("int");

                    b.Property<int>("EndMonth")
                        .HasColumnType("int");

                    b.Property<int>("Index")
                        .HasColumnType("int");

                    b.Property<bool>("LimitToDateRange")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("MonthsOfYear")
                        .HasColumnType("longtext");

                    b.Property<int>("PlayoutId")
                        .HasColumnType("int");

                    b.Property<int>("StartDay")
                        .HasColumnType("int");

                    b.Property<int>("StartMonth")
                        .HasColumnType("int");

                    b.Property<int>("TemplateId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DecoTemplateId");

                    b.HasIndex("PlayoutId");

                    b.HasIndex("TemplateId");

                    b.ToTable("PlayoutTemplate", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Template", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<int>("TemplateGroupId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.HasIndex("TemplateGroupId");

                    b.ToTable("Template", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.TemplateGroup", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("TemplateGroup", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.TemplateItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int>("BlockId")
                        .HasColumnType("int");

                    b.Property<TimeSpan>("StartTime")
                        .HasColumnType("time(6)");

                    b.Property<int>("TemplateId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("BlockId");

                    b.HasIndex("TemplateId");

                    b.ToTable("TemplateItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Outline")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("SeasonId")
                        .HasColumnType("int");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("SeasonId");

                    b.ToTable("SeasonMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ContentRating")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Outline")
                        .HasColumnType("longtext");

                    b.Property<string>("Plot")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("ShowId")
                        .HasColumnType("int");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Tagline")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ShowId");

                    b.ToTable("ShowMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SmartCollection", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<string>("Query")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("SmartCollection", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SongMetadata", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Album")
                        .HasColumnType("longtext");

                    b.PrimitiveCollection<string>("AlbumArtists")
                        .HasColumnType("longtext");

                    b.PrimitiveCollection<string>("Artists")
                        .HasColumnType("longtext");

                    b.Property<string>("Comment")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("MetadataKind")
                        .HasColumnType("int");

                    b.Property<string>("OriginalTitle")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ReleaseDate")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("SongId")
                        .HasColumnType("int");

                    b.Property<string>("SortTitle")
                        .HasColumnType("longtext");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<string>("Track")
                        .HasColumnType("longtext");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("SongId");

                    b.ToTable("SongMetadata", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Studio", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("Studio", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Style", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.ToTable("Style");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Subtitle", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Codec")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("DateAdded")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("DateUpdated")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("Default")
                        .HasColumnType("tinyint(1)");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<bool>("Forced")
                        .HasColumnType("tinyint(1)");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<bool>("IsExtracted")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.Property<string>("Language")
                        .HasColumnType("longtext");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Path")
                        .HasColumnType("longtext");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<bool>("SDH")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false);

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.Property<int>("StreamIndex")
                        .HasColumnType("int");

                    b.Property<int>("SubtitleKind")
                        .HasColumnType("int");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("Subtitle", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Tag", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("ArtistMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("ExternalCollectionId")
                        .HasColumnType("longtext");

                    b.Property<string>("ExternalTypeId")
                        .HasColumnType("longtext");

                    b.Property<int?>("ImageMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MusicVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("RemoteStreamMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SeasonMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("ShowMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("SongMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("ImageMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("RemoteStreamMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

                    b.ToTable("Tag");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktList", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<bool>("AutoRefresh")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Description")
                        .HasColumnType("longtext");

                    b.Property<bool>("GeneratePlaylist")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("ItemCount")
                        .HasColumnType("int");

                    b.Property<DateTime?>("LastMatch")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("LastUpdate")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("List")
                        .HasColumnType("longtext");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("PlaylistId")
                        .HasColumnType("int");

                    b.Property<int>("TraktId")
                        .HasColumnType("int");

                    b.Property<string>("User")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("PlaylistId");

                    b.ToTable("TraktList", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("Episode")
                        .HasColumnType("int");

                    b.Property<int>("Kind")
                        .HasColumnType("int");

                    b.Property<int?>("MediaItemId")
                        .HasColumnType("int");

                    b.Property<int>("Rank")
                        .HasColumnType("int");

                    b.Property<int?>("Season")
                        .HasColumnType("int");

                    b.Property<string>("Title")
                        .HasColumnType("longtext");

                    b.Property<int>("TraktId")
                        .HasColumnType("int");

                    b.Property<int>("TraktListId")
                        .HasColumnType("int");

                    b.Property<int?>("Year")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("TraktListId");

                    b.ToTable("TraktListItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItemGuid", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Guid")
                        .HasColumnType("longtext");

                    b.Property<int>("TraktListItemId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("TraktListItemId");

                    b.ToTable("TraktListItemGuid", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Writer", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("EpisodeMetadataId")
                        .HasColumnType("int");

                    b.Property<int?>("MovieMetadataId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<int?>("OtherVideoMetadataId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.ToTable("Writer", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Emby.EmbyPathInfo", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("EmbyLibraryId")
                        .HasColumnType("int");

                    b.Property<string>("NetworkPath")
                        .HasColumnType("longtext");

                    b.Property<string>("Path")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("EmbyLibraryId");

                    b.ToTable("EmbyPathInfo");
                });

            modelBuilder.Entity("ErsatzTV.Core.Jellyfin.JellyfinPathInfo", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<int?>("JellyfinLibraryId")
                        .HasColumnType("int");

                    b.Property<string>("NetworkPath")
                        .HasColumnType("longtext");

                    b.Property<string>("Path")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("JellyfinLibraryId");

                    b.ToTable("JellyfinPathInfo");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.Property<bool>("ShouldSyncItems")
                        .HasColumnType("tinyint(1)");

                    b.ToTable("EmbyLibrary", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.Property<bool>("ShouldSyncItems")
                        .HasColumnType("tinyint(1)");

                    b.ToTable("JellyfinLibrary", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LocalLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

                    b.ToTable("LocalLibrary", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("LastNetworksScan")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("ShouldSyncItems")
                        .HasColumnType("tinyint(1)");

                    b.ToTable("PlexLibrary", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaFile");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.Property<int>("PlexId")
                        .HasColumnType("int");

                    b.ToTable("PlexMediaFile", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Artist", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.ToTable("Artist", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.Property<int>("SeasonId")
                        .HasColumnType("int");

                    b.HasIndex("SeasonId");

                    b.ToTable("Episode", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Image", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.ToTable("Image", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.ToTable("Movie", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideo", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.Property<int>("ArtistId")
                        .HasColumnType("int");

                    b.HasIndex("ArtistId");

                    b.ToTable("MusicVideo", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideo", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.ToTable("OtherVideo", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.RemoteStream", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.Property<TimeSpan?>("Duration")
                        .HasColumnType("time(6)");

                    b.Property<string>("FallbackQuery")
                        .HasColumnType("longtext");

                    b.Property<bool>("IsLive")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Script")
                        .HasColumnType("longtext");

                    b.Property<string>("Url")
                        .HasColumnType("longtext");

                    b.ToTable("RemoteStream", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.Property<int>("SeasonNumber")
                        .HasColumnType("int");

                    b.Property<int>("ShowId")
                        .HasColumnType("int");

                    b.HasIndex("ShowId");

                    b.ToTable("Season", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.ToTable("Show", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Song", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.ToTable("Song", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.Property<DateTime?>("LastCollectionsScan")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("OperatingSystem")
                        .HasColumnType("longtext");

                    b.Property<string>("ServerName")
                        .HasColumnType("longtext");

                    b.ToTable("EmbyMediaSource", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.Property<DateTime?>("LastCollectionsScan")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("OperatingSystem")
                        .HasColumnType("longtext");

                    b.Property<string>("ServerName")
                        .HasColumnType("longtext");

                    b.ToTable("JellyfinMediaSource", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.ToTable("LocalMediaSource", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.Property<string>("ClientIdentifier")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("LastCollectionsScan")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Platform")
                        .HasColumnType("longtext");

                    b.Property<string>("PlatformVersion")
                        .HasColumnType("longtext");

                    b.Property<string>("ProductVersion")
                        .HasColumnType("longtext");

                    b.Property<string>("ServerName")
                        .HasColumnType("longtext");

                    b.ToTable("PlexMediaSource", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");

                    b.Property<int>("DiscardToFillAttempts")
                        .HasColumnType("int");

                    b.Property<TimeSpan>("PlayoutDuration")
                        .HasColumnType("time(6)");

                    b.Property<int>("TailMode")
                        .HasColumnType("int");

                    b.ToTable("ProgramScheduleDurationItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");

                    b.ToTable("ProgramScheduleFloodItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");

                    b.Property<int>("Count")
                        .HasColumnType("int");

                    b.Property<int>("MultipleMode")
                        .HasColumnType("int");

                    b.ToTable("ProgramScheduleMultipleItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");

                    b.ToTable("ProgramScheduleOneItem", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyEpisode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Episode");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("EmbyEpisode", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinEpisode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Episode");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("JellyfinEpisode", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexEpisode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Episode");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.ToTable("PlexEpisode", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMovie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Movie");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("EmbyMovie", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMovie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Movie");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("JellyfinMovie", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Movie");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.ToTable("PlexMovie", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexOtherVideo", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.OtherVideo");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.ToTable("PlexOtherVideo", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbySeason", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Season");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("EmbySeason", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinSeason", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Season");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("JellyfinSeason", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexSeason", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Season");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.ToTable("PlexSeason", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyShow", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Show");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("EmbyShow", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinShow", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Show");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("ItemId")
                        .HasColumnType("longtext");

                    b.ToTable("JellyfinShow", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexShow", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Show");

                    b.Property<string>("Etag")
                        .HasColumnType("longtext");

                    b.Property<string>("Key")
                        .HasColumnType("longtext");

                    b.ToTable("PlexShow", (string)null);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Actor", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Artwork", "Artwork")
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Actor", "ArtworkId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Artwork");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ArtistMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Artist", "Artist")
                        .WithMany("ArtistMetadata")
                        .HasForeignKey("ArtistId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Artist");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Artwork", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Channel", null)
                        .WithMany("Artwork")
                        .HasForeignKey("ChannelId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Artwork")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.FFmpegProfile", "FFmpegProfile")
                        .WithMany()
                        .HasForeignKey("FFmpegProfileId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "FallbackFiller")
                        .WithMany()
                        .HasForeignKey("FallbackFillerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.ChannelWatermark", "Watermark")
                        .WithMany()
                        .HasForeignKey("WatermarkId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("FFmpegProfile");

                    b.Navigation("FallbackFiller");

                    b.Navigation("Watermark");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.CollectionItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany("CollectionItems")
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany("CollectionItems")
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Collection");

                    b.Navigation("MediaItem");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Director", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Directors")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Directors")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Directors")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Directors")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyConnection", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.EmbyMediaSource", "EmbyMediaSource")
                        .WithMany("Connections")
                        .HasForeignKey("EmbyMediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("EmbyMediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyPathReplacement", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.EmbyMediaSource", "EmbyMediaSource")
                        .WithMany("PathReplacements")
                        .HasForeignKey("EmbyMediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("EmbyMediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Episode", "Episode")
                        .WithMany("EpisodeMetadata")
                        .HasForeignKey("EpisodeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Episode");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.FFmpegProfile", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Resolution", "Resolution")
                        .WithMany()
                        .HasForeignKey("ResolutionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Resolution");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Filler.FillerPreset", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany()
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany()
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany()
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany()
                        .HasForeignKey("SmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Collection");

                    b.Navigation("MediaItem");

                    b.Navigation("MultiCollection");

                    b.Navigation("SmartCollection");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Genre", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ImageFolderDuration", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.LibraryFolder", "LibraryFolder")
                        .WithOne("ImageFolderDuration")
                        .HasForeignKey("ErsatzTV.Core.Domain.ImageFolderDuration", "LibraryFolderId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("LibraryFolder");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ImageMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Image", "Image")
                        .WithMany("ImageMetadata")
                        .HasForeignKey("ImageId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Image");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinConnection", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.JellyfinMediaSource", "JellyfinMediaSource")
                        .WithMany("Connections")
                        .HasForeignKey("JellyfinMediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("JellyfinMediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinPathReplacement", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.JellyfinMediaSource", "JellyfinMediaSource")
                        .WithMany("PathReplacements")
                        .HasForeignKey("JellyfinMediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("JellyfinMediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaSource", "MediaSource")
                        .WithMany("Libraries")
                        .HasForeignKey("MediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryFolder", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.LibraryPath", "LibraryPath")
                        .WithMany("LibraryFolders")
                        .HasForeignKey("LibraryPathId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.LibraryFolder", "Parent")
                        .WithMany("Children")
                        .HasForeignKey("ParentId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("LibraryPath");

                    b.Navigation("Parent");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Library", "Library")
                        .WithMany("Paths")
                        .HasForeignKey("LibraryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Library");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaChapter", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaVersion", "MediaVersion")
                        .WithMany("Chapters")
                        .HasForeignKey("MediaVersionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MediaVersion");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaFile", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.LibraryFolder", "LibraryFolder")
                        .WithMany("MediaFiles")
                        .HasForeignKey("LibraryFolderId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("ErsatzTV.Core.Domain.MediaVersion", "MediaVersion")
                        .WithMany("MediaFiles")
                        .HasForeignKey("MediaVersionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("LibraryFolder");

                    b.Navigation("MediaVersion");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.LibraryPath", "LibraryPath")
                        .WithMany("MediaItems")
                        .HasForeignKey("LibraryPathId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("LibraryPath");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaStream", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaVersion", "MediaVersion")
                        .WithMany("Streams")
                        .HasForeignKey("MediaVersionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MediaVersion");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Episode", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("EpisodeId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Image", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("ImageId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Movie", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("MovieId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideo", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("MusicVideoId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideo", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("OtherVideoId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStream", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("RemoteStreamId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Song", null)
                        .WithMany("MediaVersions")
                        .HasForeignKey("SongId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MetadataGuid", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Mood", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Moods")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Movie", "Movie")
                        .WithMany("MovieMetadata")
                        .HasForeignKey("MovieId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Movie");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MultiCollectionItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany("MultiCollectionItems")
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany("MultiCollectionItems")
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Collection");

                    b.Navigation("MultiCollection");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MultiCollectionSmartItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany("MultiCollectionSmartItems")
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany("MultiCollectionSmartItems")
                        .HasForeignKey("SmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MultiCollection");

                    b.Navigation("SmartCollection");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideoArtist", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Artists")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideoMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MusicVideo", "MusicVideo")
                        .WithMany("MusicVideoMetadata")
                        .HasForeignKey("MusicVideoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MusicVideo");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideoMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.OtherVideo", "OtherVideo")
                        .WithMany("OtherVideoMetadata")
                        .HasForeignKey("OtherVideoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("OtherVideo");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playlist", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.PlaylistGroup", "PlaylistGroup")
                        .WithMany("Playlists")
                        .HasForeignKey("PlaylistGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("PlaylistGroup");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlaylistItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany()
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany()
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany()
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Playlist", "Playlist")
                        .WithMany("Items")
                        .HasForeignKey("PlaylistId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany()
                        .HasForeignKey("SmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Collection");

                    b.Navigation("MediaItem");

                    b.Navigation("MultiCollection");

                    b.Navigation("Playlist");

                    b.Navigation("SmartCollection");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel")
                        .WithMany("Playouts")
                        .HasForeignKey("ChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Deco", "Deco")
                        .WithMany("Playouts")
                        .HasForeignKey("DecoId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
                        .WithMany("Playouts")
                        .HasForeignKey("ProgramScheduleId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 =>
                        {
                            b1.Property<int>("PlayoutId")
                                .HasColumnType("int");

                            b1.Property<DateTime?>("DurationFinish")
                                .HasColumnType("datetime(6)");

                            b1.Property<bool>("InDurationFiller")
                                .HasColumnType("tinyint(1)");

                            b1.Property<bool>("InFlood")
                                .HasColumnType("tinyint(1)");

                            b1.Property<int?>("MultipleRemaining")
                                .HasColumnType("int");

                            b1.Property<int>("NextGuideGroup")
                                .HasColumnType("int");

                            b1.Property<int>("NextInstructionIndex")
                                .HasColumnType("int");

                            b1.Property<DateTime>("NextStart")
                                .HasColumnType("datetime(6)");

                            b1.HasKey("PlayoutId");

                            b1.ToTable("PlayoutAnchor", (string)null);

                            b1.WithOwner()
                                .HasForeignKey("PlayoutId");

                            b1.OwnsOne("ErsatzTV.Core.Domain.CollectionEnumeratorState", "ScheduleItemsEnumeratorState", b2 =>
                                {
                                    b2.Property<int>("PlayoutAnchorPlayoutId")
                                        .HasColumnType("int");

                                    b2.Property<int>("Index")
                                        .HasColumnType("int");

                                    b2.Property<int>("Seed")
                                        .HasColumnType("int");

                                    b2.HasKey("PlayoutAnchorPlayoutId");

                                    b2.ToTable("ScheduleItemsEnumeratorState", (string)null);

                                    b2.WithOwner()
                                        .HasForeignKey("PlayoutAnchorPlayoutId");
                                });

                            b1.Navigation("ScheduleItemsEnumeratorState");
                        });

                    b.Navigation("Anchor");

                    b.Navigation("Channel");

                    b.Navigation("Deco");

                    b.Navigation("ProgramSchedule");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany()
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout")
                        .WithMany("Items")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.ChannelWatermark", "Watermark")
                        .WithMany()
                        .HasForeignKey("WatermarkId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("MediaItem");

                    b.Navigation("Playout");

                    b.Navigation("Watermark");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutProgramScheduleAnchor", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany()
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany()
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany()
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Playlist", "Playlist")
                        .WithMany()
                        .HasForeignKey("PlaylistId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout")
                        .WithMany("ProgramScheduleAnchors")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany()
                        .HasForeignKey("SmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.OwnsOne("ErsatzTV.Core.Domain.CollectionEnumeratorState", "EnumeratorState", b1 =>
                        {
                            b1.Property<int>("PlayoutProgramScheduleAnchorId")
                                .HasColumnType("int");

                            b1.Property<int>("Index")
                                .HasColumnType("int");

                            b1.Property<int>("Seed")
                                .HasColumnType("int");

                            b1.HasKey("PlayoutProgramScheduleAnchorId");

                            b1.ToTable("CollectionEnumeratorState", (string)null);

                            b1.WithOwner()
                                .HasForeignKey("PlayoutProgramScheduleAnchorId");
                        });

                    b.Navigation("Collection");

                    b.Navigation("EnumeratorState");

                    b.Navigation("MediaItem");

                    b.Navigation("MultiCollection");

                    b.Navigation("Playlist");

                    b.Navigation("Playout");

                    b.Navigation("SmartCollection");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlayoutScheduleItemFillGroupIndex", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout")
                        .WithMany("FillGroupIndices")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", "ProgramScheduleItem")
                        .WithMany()
                        .HasForeignKey("ProgramScheduleItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.OwnsOne("ErsatzTV.Core.Domain.CollectionEnumeratorState", "EnumeratorState", b1 =>
                        {
                            b1.Property<int>("PlayoutScheduleItemFillGroupIndexId")
                                .HasColumnType("int");

                            b1.Property<int>("Index")
                                .HasColumnType("int");

                            b1.Property<int>("Seed")
                                .HasColumnType("int");

                            b1.HasKey("PlayoutScheduleItemFillGroupIndexId");

                            b1.ToTable("FillGroupEnumeratorState", (string)null);

                            b1.WithOwner()
                                .HasForeignKey("PlayoutScheduleItemFillGroupIndexId");
                        });

                    b.Navigation("EnumeratorState");

                    b.Navigation("Playout");

                    b.Navigation("ProgramScheduleItem");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexConnection", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", "PlexMediaSource")
                        .WithMany("Connections")
                        .HasForeignKey("PlexMediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("PlexMediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexPathReplacement", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.PlexMediaSource", "PlexMediaSource")
                        .WithMany("PathReplacements")
                        .HasForeignKey("PlexMediaSourceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("PlexMediaSource");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleAlternate", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout")
                        .WithMany("ProgramScheduleAlternates")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
                        .WithMany("ProgramScheduleAlternates")
                        .HasForeignKey("ProgramScheduleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Playout");

                    b.Navigation("ProgramSchedule");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany()
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "FallbackFiller")
                        .WithMany()
                        .HasForeignKey("FallbackFillerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany()
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "MidRollFiller")
                        .WithMany()
                        .HasForeignKey("MidRollFillerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany()
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Playlist", "Playlist")
                        .WithMany()
                        .HasForeignKey("PlaylistId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "PostRollFiller")
                        .WithMany()
                        .HasForeignKey("PostRollFillerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "PreRollFiller")
                        .WithMany()
                        .HasForeignKey("PreRollFillerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
                        .WithMany("Items")
                        .HasForeignKey("ProgramScheduleId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany()
                        .HasForeignKey("SmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Filler.FillerPreset", "TailFiller")
                        .WithMany()
                        .HasForeignKey("TailFillerId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.ChannelWatermark", "Watermark")
                        .WithMany()
                        .HasForeignKey("WatermarkId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Collection");

                    b.Navigation("FallbackFiller");

                    b.Navigation("MediaItem");

                    b.Navigation("MidRollFiller");

                    b.Navigation("MultiCollection");

                    b.Navigation("Playlist");

                    b.Navigation("PostRollFiller");

                    b.Navigation("PreRollFiller");

                    b.Navigation("ProgramSchedule");

                    b.Navigation("SmartCollection");

                    b.Navigation("TailFiller");

                    b.Navigation("Watermark");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.RemoteStreamMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.RemoteStream", "RemoteStream")
                        .WithMany("RemoteStreamMetadata")
                        .HasForeignKey("RemoteStreamId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("RemoteStream");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Block", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.BlockGroup", "BlockGroup")
                        .WithMany("Blocks")
                        .HasForeignKey("BlockGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("BlockGroup");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.BlockItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Block", "Block")
                        .WithMany("Items")
                        .HasForeignKey("BlockId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Collection", "Collection")
                        .WithMany()
                        .HasForeignKey("CollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany()
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "MultiCollection")
                        .WithMany()
                        .HasForeignKey("MultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany()
                        .HasForeignKey("SmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Block");

                    b.Navigation("Collection");

                    b.Navigation("MediaItem");

                    b.Navigation("MultiCollection");

                    b.Navigation("SmartCollection");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Deco", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Collection", "DeadAirFallbackCollection")
                        .WithMany()
                        .HasForeignKey("DeadAirFallbackCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "DeadAirFallbackMediaItem")
                        .WithMany()
                        .HasForeignKey("DeadAirFallbackMediaItemId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "DeadAirFallbackMultiCollection")
                        .WithMany()
                        .HasForeignKey("DeadAirFallbackMultiCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "DeadAirFallbackSmartCollection")
                        .WithMany()
                        .HasForeignKey("DeadAirFallbackSmartCollectionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.DecoGroup", "DecoGroup")
                        .WithMany("Decos")
                        .HasForeignKey("DecoGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Collection", "DefaultFillerCollection")
                        .WithMany()
                        .HasForeignKey("DefaultFillerCollectionId");

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "DefaultFillerMediaItem")
                        .WithMany()
                        .HasForeignKey("DefaultFillerMediaItemId");

                    b.HasOne("ErsatzTV.Core.Domain.MultiCollection", "DefaultFillerMultiCollection")
                        .WithMany()
                        .HasForeignKey("DefaultFillerMultiCollectionId");

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "DefaultFillerSmartCollection")
                        .WithMany()
                        .HasForeignKey("DefaultFillerSmartCollectionId");

                    b.HasOne("ErsatzTV.Core.Domain.ChannelWatermark", "Watermark")
                        .WithMany()
                        .HasForeignKey("WatermarkId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("DeadAirFallbackCollection");

                    b.Navigation("DeadAirFallbackMediaItem");

                    b.Navigation("DeadAirFallbackMultiCollection");

                    b.Navigation("DeadAirFallbackSmartCollection");

                    b.Navigation("DecoGroup");

                    b.Navigation("DefaultFillerCollection");

                    b.Navigation("DefaultFillerMediaItem");

                    b.Navigation("DefaultFillerMultiCollection");

                    b.Navigation("DefaultFillerSmartCollection");

                    b.Navigation("Watermark");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplate", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.DecoTemplateGroup", "DecoTemplateGroup")
                        .WithMany("DecoTemplates")
                        .HasForeignKey("DecoTemplateGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("DecoTemplateGroup");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplateItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Deco", "Deco")
                        .WithMany()
                        .HasForeignKey("DecoId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.DecoTemplate", "DecoTemplate")
                        .WithMany("Items")
                        .HasForeignKey("DecoTemplateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Deco");

                    b.Navigation("DecoTemplate");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.PlayoutHistory", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Block", "Block")
                        .WithMany("PlayoutHistory")
                        .HasForeignKey("BlockId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout")
                        .WithMany("PlayoutHistory")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Block");

                    b.Navigation("Playout");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.PlayoutTemplate", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.DecoTemplate", "DecoTemplate")
                        .WithMany("PlayoutTemplates")
                        .HasForeignKey("DecoTemplateId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.Playout", "Playout")
                        .WithMany("Templates")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Template", "Template")
                        .WithMany("PlayoutTemplates")
                        .HasForeignKey("TemplateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("DecoTemplate");

                    b.Navigation("Playout");

                    b.Navigation("Template");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Template", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.TemplateGroup", "TemplateGroup")
                        .WithMany("Templates")
                        .HasForeignKey("TemplateGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("TemplateGroup");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.TemplateItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Block", "Block")
                        .WithMany("TemplateItems")
                        .HasForeignKey("BlockId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Scheduling.Template", "Template")
                        .WithMany("Items")
                        .HasForeignKey("TemplateId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Block");

                    b.Navigation("Template");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Season", "Season")
                        .WithMany("SeasonMetadata")
                        .HasForeignKey("SeasonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Season");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Show", "Show")
                        .WithMany("ShowMetadata")
                        .HasForeignKey("ShowId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Show");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SongMetadata", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Song", "Song")
                        .WithMany("SongMetadata")
                        .HasForeignKey("SongId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Song");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Studio", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Style", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Styles")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Subtitle", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Subtitles")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Tag", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("ArtistMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ImageMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("ImageMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("MusicVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.RemoteStreamMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("RemoteStreamMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("SeasonMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.ShowMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("ShowMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.SongMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("SongMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktList", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Playlist", "Playlist")
                        .WithMany()
                        .HasForeignKey("PlaylistId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Playlist");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItem", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", "MediaItem")
                        .WithMany("TraktListItems")
                        .HasForeignKey("MediaItemId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("ErsatzTV.Core.Domain.TraktList", "TraktList")
                        .WithMany("Items")
                        .HasForeignKey("TraktListId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MediaItem");

                    b.Navigation("TraktList");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItemGuid", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.TraktListItem", "TraktListItem")
                        .WithMany("Guids")
                        .HasForeignKey("TraktListItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("TraktListItem");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Writer", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Writers")
                        .HasForeignKey("EpisodeMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MovieMetadata", null)
                        .WithMany("Writers")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Writers")
                        .HasForeignKey("OtherVideoMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Emby.EmbyPathInfo", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.EmbyLibrary", null)
                        .WithMany("PathInfos")
                        .HasForeignKey("EmbyLibraryId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Jellyfin.JellyfinPathInfo", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.JellyfinLibrary", null)
                        .WithMany("PathInfos")
                        .HasForeignKey("JellyfinLibraryId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyLibrary", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Library", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.EmbyLibrary", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinLibrary", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Library", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.JellyfinLibrary", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LocalLibrary", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Library", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.LocalLibrary", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexLibrary", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Library", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexLibrary", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaFile", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexMediaFile", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Artist", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Artist", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Episode", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Season", "Season")
                        .WithMany("Episodes")
                        .HasForeignKey("SeasonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Season");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Image", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Image", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Movie", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideo", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Artist", "Artist")
                        .WithMany("MusicVideos")
                        .HasForeignKey("ArtistId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.MusicVideo", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Artist");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideo", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.OtherVideo", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.RemoteStream", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.RemoteStream", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Season", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.Show", "Show")
                        .WithMany("Seasons")
                        .HasForeignKey("ShowId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Show");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Show", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Song", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.Song", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMediaSource", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.EmbyMediaSource", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMediaSource", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.JellyfinMediaSource", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LocalMediaSource", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.LocalMediaSource", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.MediaSource", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexMediaSource", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemFlood", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemMultiple", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemOne", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.ProgramScheduleItemOne", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyEpisode", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Episode", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.EmbyEpisode", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinEpisode", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Episode", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.JellyfinEpisode", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexEpisode", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Episode", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexEpisode", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMovie", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Movie", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.EmbyMovie", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMovie", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Movie", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.JellyfinMovie", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Movie", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexMovie", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexOtherVideo", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.OtherVideo", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexOtherVideo", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbySeason", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Season", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.EmbySeason", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinSeason", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Season", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.JellyfinSeason", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexSeason", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Season", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexSeason", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyShow", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Show", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.EmbyShow", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinShow", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Show", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.JellyfinShow", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexShow", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Show", null)
                        .WithOne()
                        .HasForeignKey("ErsatzTV.Core.Domain.PlexShow", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ArtistMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Moods");

                    b.Navigation("Studios");

                    b.Navigation("Styles");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Channel", b =>
                {
                    b.Navigation("Artwork");

                    b.Navigation("Playouts");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Collection", b =>
                {
                    b.Navigation("CollectionItems");

                    b.Navigation("MultiCollectionItems");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EpisodeMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Directors");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");

                    b.Navigation("Writers");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ImageMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
                {
                    b.Navigation("Paths");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryFolder", b =>
                {
                    b.Navigation("Children");

                    b.Navigation("ImageFolderDuration");

                    b.Navigation("MediaFiles");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.LibraryPath", b =>
                {
                    b.Navigation("LibraryFolders");

                    b.Navigation("MediaItems");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaItem", b =>
                {
                    b.Navigation("CollectionItems");

                    b.Navigation("TraktListItems");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaSource", b =>
                {
                    b.Navigation("Libraries");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MediaVersion", b =>
                {
                    b.Navigation("Chapters");

                    b.Navigation("MediaFiles");

                    b.Navigation("Streams");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MovieMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Directors");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");

                    b.Navigation("Writers");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MultiCollection", b =>
                {
                    b.Navigation("MultiCollectionItems");

                    b.Navigation("MultiCollectionSmartItems");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideoMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artists");

                    b.Navigation("Artwork");

                    b.Navigation("Directors");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideoMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Directors");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");

                    b.Navigation("Writers");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playlist", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlaylistGroup", b =>
                {
                    b.Navigation("Playlists");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
                {
                    b.Navigation("FillGroupIndices");

                    b.Navigation("Items");

                    b.Navigation("PlayoutHistory");

                    b.Navigation("ProgramScheduleAlternates");

                    b.Navigation("ProgramScheduleAnchors");

                    b.Navigation("Templates");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("Playouts");

                    b.Navigation("ProgramScheduleAlternates");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.RemoteStreamMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Block", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("PlayoutHistory");

                    b.Navigation("TemplateItems");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.BlockGroup", b =>
                {
                    b.Navigation("Blocks");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Deco", b =>
                {
                    b.Navigation("Playouts");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoGroup", b =>
                {
                    b.Navigation("Decos");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplate", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("PlayoutTemplates");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.DecoTemplateGroup", b =>
                {
                    b.Navigation("DecoTemplates");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.Template", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("PlayoutTemplates");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Scheduling.TemplateGroup", b =>
                {
                    b.Navigation("Templates");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ShowMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SmartCollection", b =>
                {
                    b.Navigation("MultiCollectionSmartItems");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SongMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Subtitles");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktList", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.TraktListItem", b =>
                {
                    b.Navigation("Guids");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyLibrary", b =>
                {
                    b.Navigation("PathInfos");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinLibrary", b =>
                {
                    b.Navigation("PathInfos");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Artist", b =>
                {
                    b.Navigation("ArtistMetadata");

                    b.Navigation("MusicVideos");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
                {
                    b.Navigation("EpisodeMetadata");

                    b.Navigation("MediaVersions");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Image", b =>
                {
                    b.Navigation("ImageMetadata");

                    b.Navigation("MediaVersions");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Movie", b =>
                {
                    b.Navigation("MediaVersions");

                    b.Navigation("MovieMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.MusicVideo", b =>
                {
                    b.Navigation("MediaVersions");

                    b.Navigation("MusicVideoMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideo", b =>
                {
                    b.Navigation("MediaVersions");

                    b.Navigation("OtherVideoMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.RemoteStream", b =>
                {
                    b.Navigation("MediaVersions");

                    b.Navigation("RemoteStreamMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Season", b =>
                {
                    b.Navigation("Episodes");

                    b.Navigation("SeasonMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Show", b =>
                {
                    b.Navigation("Seasons");

                    b.Navigation("ShowMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Song", b =>
                {
                    b.Navigation("MediaVersions");

                    b.Navigation("SongMetadata");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMediaSource", b =>
                {
                    b.Navigation("Connections");

                    b.Navigation("PathReplacements");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMediaSource", b =>
                {
                    b.Navigation("Connections");

                    b.Navigation("PathReplacements");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
                {
                    b.Navigation("Connections");

                    b.Navigation("PathReplacements");
                });
#pragma warning restore 612, 618
        }
    }
}
