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

#nullable disable

namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
    [DbContext(typeof(TvContext))]
    [Migration("20211124122445_Add_SongAlbum")]
    partial class Add_SongAlbum
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "6.0.0");

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

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

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    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("INTEGER");

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistId");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("ChannelId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    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("INTEGER");

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

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

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

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

                    b.Property<string>("PreferredLanguageCode")
                        .HasColumnType("TEXT");

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

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

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

                    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("INTEGER");

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

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

                    b.Property<int>("HorizontalMarginPercent")
                        .HasColumnType("INTEGER");

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

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

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

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

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

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

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

                    b.Property<int>("VerticalMarginPercent")
                        .HasColumnType("INTEGER");

                    b.Property<int>("WidthPercent")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

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

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

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

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

                    b.HasKey("Id");

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

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

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

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

                    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("INTEGER");

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

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

                    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("INTEGER");

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("EmbyMediaSourceId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("EmbyMediaSourceId");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("EpisodeId");

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

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

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

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

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

                    b.Property<string>("AudioCodec")
                        .HasColumnType("TEXT");

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

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

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

                    b.Property<bool>("NormalizeAudio")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("NormalizeLoudness")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("NormalizeVideo")
                        .HasColumnType("INTEGER");

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

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

                    b.Property<bool>("Transcode")
                        .HasColumnType("INTEGER");

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

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

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

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

                    b.Property<string>("VideoCodec")
                        .HasColumnType("TEXT");

                    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("INTEGER");

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

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

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

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

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

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

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

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

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

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

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

                    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("INTEGER");

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    b.HasIndex("SeasonMetadataId");

                    b.HasIndex("ShowMetadataId");

                    b.HasIndex("SongMetadataId");

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("JellyfinMediaSourceId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("JellyfinMediaSourceId");

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

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

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

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

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

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

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

                    b.HasKey("Id");

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MediaSourceId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("LibraryPathId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("LibraryId");

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MediaVersionId");

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MediaVersionId");

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("LibraryPathId");

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

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

                    b.HasKey("Id");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MediaVersionId");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("EpisodeId");

                    b.HasIndex("MovieId");

                    b.HasIndex("MusicVideoId");

                    b.HasIndex("OtherVideoId");

                    b.HasIndex("SongId");

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    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("INTEGER");

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MovieId");

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

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

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

                    b.HasKey("Id");

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

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

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

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

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

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

                    b.HasIndex("CollectionId");

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

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

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

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

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

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

                    b.HasIndex("SmartCollectionId");

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MusicVideoId");

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("OtherVideoId");

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ChannelId");

                    b.HasIndex("ProgramScheduleId");

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("PlayoutId");

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("CollectionId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("PlayoutId");

                    b.HasIndex("ProgramScheduleId");

                    b.HasIndex("SmartCollectionId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("PlexMediaSourceId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("PlexMediaSourceId");

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

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

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

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

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

                    b.HasKey("Id");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("CollectionId");

                    b.HasIndex("FallbackFillerId");

                    b.HasIndex("MediaItemId");

                    b.HasIndex("MidRollFillerId");

                    b.HasIndex("MultiCollectionId");

                    b.HasIndex("PostRollFillerId");

                    b.HasIndex("PreRollFillerId");

                    b.HasIndex("ProgramScheduleId");

                    b.HasIndex("SmartCollectionId");

                    b.HasIndex("TailFillerId");

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

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

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

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

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

                    b.HasKey("Id");

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("SeasonId");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ShowId");

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

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

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

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

                    b.HasKey("Id");

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

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

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

                    b.Property<string>("Artist")
                        .HasColumnType("TEXT");

                    b.Property<string>("Date")
                        .HasColumnType("TEXT");

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("SongId");

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    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("INTEGER");

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

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

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

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

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

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

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

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("ArtistMetadataId");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.HasIndex("MusicVideoMetadataId");

                    b.HasIndex("OtherVideoMetadataId");

                    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("INTEGER");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<int>("ItemCount")
                        .HasColumnType("INTEGER");

                    b.Property<string>("List")
                        .HasColumnType("TEXT");

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

                    b.Property<int>("TraktId")
                        .HasColumnType("INTEGER");

                    b.Property<string>("User")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

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

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

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

                    b.Property<int>("Kind")
                        .HasColumnType("INTEGER");

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

                    b.Property<int>("Rank")
                        .HasColumnType("INTEGER");

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

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

                    b.Property<int>("TraktId")
                        .HasColumnType("INTEGER");

                    b.Property<int>("TraktListId")
                        .HasColumnType("INTEGER");

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

                    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("INTEGER");

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

                    b.Property<int>("TraktListItemId")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("TraktListItemId");

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

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

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

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

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

                    b.HasKey("Id");

                    b.HasIndex("EpisodeMetadataId");

                    b.HasIndex("MovieMetadataId");

                    b.ToTable("Writer", (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.EmbyLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

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

                    b.Property<bool>("ShouldSyncItems")
                        .HasColumnType("INTEGER");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.Property<string>("OperatingSystem")
                        .HasColumnType("TEXT");

                    b.Property<string>("ServerName")
                        .HasColumnType("TEXT");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

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

                    b.HasIndex("SeasonId");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

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

                    b.Property<bool>("ShouldSyncItems")
                        .HasColumnType("INTEGER");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.Property<string>("OperatingSystem")
                        .HasColumnType("TEXT");

                    b.Property<string>("ServerName")
                        .HasColumnType("TEXT");

                    b.ToTable("JellyfinMediaSource", (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.LocalMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.ToTable("LocalMediaSource", (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("INTEGER");

                    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.PlexLibrary", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Library");

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

                    b.Property<bool>("ShouldSyncItems")
                        .HasColumnType("INTEGER");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaFile", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaFile");

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

                    b.Property<int>("PlexId")
                        .HasColumnType("INTEGER");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMediaSource", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaSource");

                    b.Property<string>("ClientIdentifier")
                        .HasColumnType("TEXT");

                    b.Property<string>("Platform")
                        .HasColumnType("TEXT");

                    b.Property<string>("PlatformVersion")
                        .HasColumnType("TEXT");

                    b.Property<string>("ProductVersion")
                        .HasColumnType("TEXT");

                    b.Property<string>("ServerName")
                        .HasColumnType("TEXT");

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramScheduleItemDuration", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.ProgramScheduleItem");

                    b.Property<TimeSpan>("PlayoutDuration")
                        .HasColumnType("TEXT");

                    b.Property<int>("TailMode")
                        .HasColumnType("INTEGER");

                    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("INTEGER");

                    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.Season", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.MediaItem");

                    b.Property<int>("SeasonNumber")
                        .HasColumnType("INTEGER");

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

                    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.EmbyEpisode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Episode");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMovie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Movie");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbySeason", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Season");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyShow", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Show");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinEpisode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Episode");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMovie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Movie");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinSeason", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Season");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinShow", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Show");

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

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexEpisode", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Episode");

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexMovie", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Movie");

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexSeason", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Season");

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.PlexShow", b =>
                {
                    b.HasBaseType("ErsatzTV.Core.Domain.Show");

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

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

            modelBuilder.Entity("ErsatzTV.Core.Domain.Actor", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("ArtistMetadataId");

                    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.MovieMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("MovieMetadataId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("ErsatzTV.Core.Domain.MusicVideoMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("MusicVideoMetadataId");

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("OtherVideoMetadataId");

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Actors")
                        .HasForeignKey("SeasonMetadataId");

                    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");

                    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.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.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);
                });

            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");

                    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");

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Genres")
                        .HasForeignKey("SeasonMetadataId");

                    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.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.Navigation("LibraryPath");
                });

            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.MediaVersion", "MediaVersion")
                        .WithMany("MediaFiles")
                        .HasForeignKey("MediaVersionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    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.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.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");

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("EpisodeMetadataId")
                        .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");

                    b.HasOne("ErsatzTV.Core.Domain.OtherVideoMetadata", null)
                        .WithMany("Guids")
                        .HasForeignKey("OtherVideoMetadataId");

                    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");
                });

            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.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.Playout", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.Channel", "Channel")
                        .WithMany("Playouts")
                        .HasForeignKey("ChannelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
                        .WithMany("Playouts")
                        .HasForeignKey("ProgramScheduleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.OwnsOne("ErsatzTV.Core.Domain.PlayoutAnchor", "Anchor", b1 =>
                        {
                            b1.Property<int>("PlayoutId")
                                .HasColumnType("INTEGER");

                            b1.Property<DateTime?>("DurationFinish")
                                .HasColumnType("TEXT");

                            b1.Property<bool>("InDurationFiller")
                                .HasColumnType("INTEGER");

                            b1.Property<bool>("InFlood")
                                .HasColumnType("INTEGER");

                            b1.Property<int?>("MultipleRemaining")
                                .HasColumnType("INTEGER");

                            b1.Property<int>("NextGuideGroup")
                                .HasColumnType("INTEGER");

                            b1.Property<int>("NextScheduleItemId")
                                .HasColumnType("INTEGER");

                            b1.Property<DateTime>("NextStart")
                                .HasColumnType("TEXT");

                            b1.HasKey("PlayoutId");

                            b1.HasIndex("NextScheduleItemId");

                            b1.ToTable("PlayoutAnchor", (string)null);

                            b1.HasOne("ErsatzTV.Core.Domain.ProgramScheduleItem", "NextScheduleItem")
                                .WithMany()
                                .HasForeignKey("NextScheduleItemId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.WithOwner()
                                .HasForeignKey("PlayoutId");

                            b1.Navigation("NextScheduleItem");
                        });

                    b.Navigation("Anchor");

                    b.Navigation("Channel");

                    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.Navigation("MediaItem");

                    b.Navigation("Playout");
                });

            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.Playout", "Playout")
                        .WithMany("ProgramScheduleAnchors")
                        .HasForeignKey("PlayoutId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.ProgramSchedule", "ProgramSchedule")
                        .WithMany()
                        .HasForeignKey("ProgramScheduleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("ErsatzTV.Core.Domain.SmartCollection", "SmartCollection")
                        .WithMany()
                        .HasForeignKey("SmartCollectionId");

                    b.OwnsOne("ErsatzTV.Core.Domain.CollectionEnumeratorState", "EnumeratorState", b1 =>
                        {
                            b1.Property<int>("PlayoutProgramScheduleAnchorId")
                                .HasColumnType("INTEGER");

                            b1.Property<int>("Index")
                                .HasColumnType("INTEGER");

                            b1.Property<int>("Seed")
                                .HasColumnType("INTEGER");

                            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("Playout");

                    b.Navigation("ProgramSchedule");

                    b.Navigation("SmartCollection");
                });

            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.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.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)
                        .IsRequired();

                    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.Navigation("Collection");

                    b.Navigation("FallbackFiller");

                    b.Navigation("MediaItem");

                    b.Navigation("MidRollFiller");

                    b.Navigation("MultiCollection");

                    b.Navigation("PostRollFiller");

                    b.Navigation("PreRollFiller");

                    b.Navigation("ProgramSchedule");

                    b.Navigation("SmartCollection");

                    b.Navigation("TailFiller");
                });

            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");

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("EpisodeMetadataId");

                    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");

                    b.HasOne("ErsatzTV.Core.Domain.SeasonMetadata", null)
                        .WithMany("Studios")
                        .HasForeignKey("SeasonMetadataId");

                    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.Tag", b =>
                {
                    b.HasOne("ErsatzTV.Core.Domain.ArtistMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("ArtistMetadataId");

                    b.HasOne("ErsatzTV.Core.Domain.EpisodeMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("EpisodeMetadataId");

                    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.SeasonMetadata", null)
                        .WithMany("Tags")
                        .HasForeignKey("SeasonMetadataId");

                    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.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);
                });

            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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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("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("Tags");

                    b.Navigation("Writers");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Library", b =>
                {
                    b.Navigation("Paths");
                });

            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("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("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.OtherVideoMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    b.Navigation("Tags");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Playout", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("ProgramScheduleAnchors");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.ProgramSchedule", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("Playouts");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.SeasonMetadata", b =>
                {
                    b.Navigation("Actors");

                    b.Navigation("Artwork");

                    b.Navigation("Genres");

                    b.Navigation("Guids");

                    b.Navigation("Studios");

                    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("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("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.Artist", b =>
                {
                    b.Navigation("ArtistMetadata");

                    b.Navigation("MusicVideos");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.EmbyMediaSource", b =>
                {
                    b.Navigation("Connections");

                    b.Navigation("PathReplacements");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.Episode", b =>
                {
                    b.Navigation("EpisodeMetadata");

                    b.Navigation("MediaVersions");
                });

            modelBuilder.Entity("ErsatzTV.Core.Domain.JellyfinMediaSource", b =>
                {
                    b.Navigation("Connections");

                    b.Navigation("PathReplacements");
                });

            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.PlexMediaSource", b =>
                {
                    b.Navigation("Connections");

                    b.Navigation("PathReplacements");
                });

            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");
                });
#pragma warning restore 612, 618
        }
    }
}
