// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using WatchIt.Database;

#nullable disable

namespace WatchIt.Database.Migrations
{
    [DbContext(typeof(DatabaseContext))]
    [Migration("20240603131015_Fix")]
    partial class Fix
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.5")
                .HasAnnotation("Proxies:ChangeTracking", false)
                .HasAnnotation("Proxies:CheckEquality", false)
                .HasAnnotation("Proxies:LazyLoading", true)
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("WatchIt.Database.Model.Account.Account", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<Guid?>("BackgroundPictureId")
                        .HasColumnType("uuid");

                    b.Property<DateTime>("CreationDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasMaxLength(320)
                        .HasColumnType("character varying(320)");

                    b.Property<short?>("GenderId")
                        .HasColumnType("smallint");

                    b.Property<bool>("IsAdmin")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<DateTime>("LastActive")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.Property<string>("LeftSalt")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<byte[]>("Password")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("bytea");

                    b.Property<Guid?>("ProfilePictureId")
                        .HasColumnType("uuid");

                    b.Property<string>("RightSalt")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("character varying(20)");

                    b.Property<string>("Username")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.HasKey("Id");

                    b.HasIndex("BackgroundPictureId");

                    b.HasIndex("GenderId");

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

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

                    b.ToTable("Accounts");

                    b.HasData(
                        new
                        {
                            Id = 1L,
                            CreationDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                            Email = "root@watch.it",
                            IsAdmin = true,
                            LastActive = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                            LeftSalt = "@(0PF{b6Ot?HO*:yF5`L",
                            Password = new byte[] { 254, 122, 19, 59, 187, 100, 174, 87, 55, 108, 14, 10, 123, 186, 129, 243, 145, 136, 152, 220, 72, 170, 196, 93, 54, 88, 192, 115, 128, 76, 133, 9, 181, 99, 181, 8, 102, 123, 197, 251, 85, 167, 146, 28, 116, 249, 118, 87, 146, 8, 194, 238, 127, 19, 33, 28, 14, 222, 218, 170, 74, 40, 223, 232 },
                            RightSalt = "=pt,3T0#CfC1[}Zfp{/u",
                            Username = "root"
                        });
                });

            modelBuilder.Entity("WatchIt.Database.Model.Account.AccountProfilePicture", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<byte[]>("Image")
                        .IsRequired()
                        .HasMaxLength(-1)
                        .HasColumnType("bytea");

                    b.Property<string>("MimeType")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<DateTime>("UploadDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Account.AccountRefreshToken", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<DateTime>("ExpirationDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsExtendable")
                        .HasColumnType("boolean");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Common.Country", b =>
                {
                    b.Property<short>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("smallint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));

                    b.Property<bool>("IsHistorical")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.HasKey("Id");

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

                    b.ToTable("Countries");

                    b.HasData(
                        new
                        {
                            Id = (short)1,
                            IsHistorical = false,
                            Name = "Afghanistan"
                        },
                        new
                        {
                            Id = (short)2,
                            IsHistorical = false,
                            Name = "Albania"
                        });
                });

            modelBuilder.Entity("WatchIt.Database.Model.Common.Gender", b =>
                {
                    b.Property<short>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("smallint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));

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

                    b.HasKey("Id");

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

                    b.ToTable("Genders");

                    b.HasData(
                        new
                        {
                            Id = (short)1,
                            Name = "Male"
                        },
                        new
                        {
                            Id = (short)2,
                            Name = "Female"
                        });
                });

            modelBuilder.Entity("WatchIt.Database.Model.Common.Genre", b =>
                {
                    b.Property<short>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("smallint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.HasKey("Id");

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

                    b.ToTable("Genres");

                    b.HasData(
                        new
                        {
                            Id = (short)1,
                            Name = "Comedy"
                        },
                        new
                        {
                            Id = (short)2,
                            Name = "Thriller"
                        },
                        new
                        {
                            Id = (short)3,
                            Name = "Horror"
                        },
                        new
                        {
                            Id = (short)4,
                            Name = "Action"
                        },
                        new
                        {
                            Id = (short)5,
                            Name = "Drama"
                        });
                });

            modelBuilder.Entity("WatchIt.Database.Model.Media.Media", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<short?>("Length")
                        .HasColumnType("smallint");

                    b.Property<Guid?>("MediaPosterImageId")
                        .HasColumnType("uuid");

                    b.Property<string>("OriginalTitle")
                        .HasMaxLength(250)
                        .HasColumnType("character varying(250)");

                    b.Property<DateOnly?>("ReleaseDate")
                        .HasColumnType("date");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(250)
                        .HasColumnType("character varying(250)");

                    b.HasKey("Id");

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

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaGenre", b =>
                {
                    b.Property<short>("GenreId")
                        .HasColumnType("smallint");

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

                    b.HasKey("GenreId", "MediaId");

                    b.HasIndex("MediaId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaMovie", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<decimal?>("Budget")
                        .HasColumnType("money");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<byte[]>("Image")
                        .IsRequired()
                        .HasMaxLength(-1)
                        .HasColumnType("bytea");

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

                    b.Property<string>("MimeType")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<DateTime>("UploadDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.HasKey("Id");

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

                    b.HasIndex("MediaId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b =>
                {
                    b.Property<Guid>("Id")
                        .HasColumnType("uuid");

                    b.Property<byte[]>("FirstGradientColor")
                        .IsRequired()
                        .HasMaxLength(3)
                        .HasColumnType("bytea");

                    b.Property<bool>("IsUniversalBackground")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<byte[]>("SecondGradientColor")
                        .IsRequired()
                        .HasMaxLength(3)
                        .HasColumnType("bytea");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<byte[]>("Image")
                        .IsRequired()
                        .HasMaxLength(-1)
                        .HasColumnType("bytea");

                    b.Property<string>("MimeType")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<DateTime>("UploadDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaProductionCountry", b =>
                {
                    b.Property<short>("CountryId")
                        .HasColumnType("smallint");

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

                    b.HasKey("CountryId", "MediaId");

                    b.HasIndex("MediaId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<bool>("HasEnded")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesEpisode", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<bool>("IsSpecial")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false);

                    b.Property<Guid>("MediaSeriesSeasonId")
                        .HasColumnType("uuid");

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

                    b.Property<short>("Number")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

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

                    b.HasIndex("MediaSeriesSeasonId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesSeason", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

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

                    b.Property<short>("Number")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

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

                    b.HasIndex("MediaSeriesId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.Person", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<DateOnly?>("BirthDate")
                        .HasColumnType("date");

                    b.Property<DateOnly?>("DeathDate")
                        .HasColumnType("date");

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)");

                    b.Property<string>("FullName")
                        .HasMaxLength(200)
                        .HasColumnType("character varying(200)");

                    b.Property<short?>("GenderId")
                        .HasColumnType("smallint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.Property<Guid?>("PersonPhotoId")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("GenderId");

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

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRole", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<short>("PersonActorRoleTypeId")
                        .HasColumnType("smallint");

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

                    b.Property<string>("RoleName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

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

                    b.HasIndex("MediaId");

                    b.HasIndex("PersonActorRoleTypeId");

                    b.HasIndex("PersonId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRoleType", b =>
                {
                    b.Property<short>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("smallint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.HasKey("Id");

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

                    b.ToTable("PersonActorRoleTypes");

                    b.HasData(
                        new
                        {
                            Id = (short)1,
                            Name = "Actor"
                        },
                        new
                        {
                            Id = (short)2,
                            Name = "Supporting actor"
                        },
                        new
                        {
                            Id = (short)3,
                            Name = "Voice actor"
                        });
                });

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRole", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<short>("PersonCreatorRoleTypeId")
                        .HasColumnType("smallint");

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

                    b.HasKey("Id");

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

                    b.HasIndex("MediaId");

                    b.HasIndex("PersonCreatorRoleTypeId");

                    b.HasIndex("PersonId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRoleType", b =>
                {
                    b.Property<short>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("smallint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<short>("Id"));

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)");

                    b.HasKey("Id");

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

                    b.ToTable("PersonCreatorRoleTypes");

                    b.HasData(
                        new
                        {
                            Id = (short)1,
                            Name = "Director"
                        },
                        new
                        {
                            Id = (short)2,
                            Name = "Producer"
                        },
                        new
                        {
                            Id = (short)3,
                            Name = "Screenwriter"
                        });
                });

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonPhotoImage", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<byte[]>("Image")
                        .IsRequired()
                        .HasMaxLength(-1)
                        .HasColumnType("bytea");

                    b.Property<string>("MimeType")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)");

                    b.Property<DateTime>("UploadDate")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasDefaultValueSql("now()");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMedia", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

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

                    b.Property<short>("Rating")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

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

                    b.HasIndex("MediaId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesEpisode", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("MediaSeriesEpisodeId")
                        .HasColumnType("uuid");

                    b.Property<short>("Rating")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

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

                    b.HasIndex("MediaSeriesEpisodeId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesSeason", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("MediaSeriesSeasonId")
                        .HasColumnType("uuid");

                    b.Property<short>("Rating")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

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

                    b.HasIndex("MediaSeriesSeasonId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonActorRole", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("PersonActorRoleId")
                        .HasColumnType("uuid");

                    b.Property<short>("Rating")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

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

                    b.HasIndex("PersonActorRoleId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonCreatorRole", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

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

                    b.Property<Guid>("PersonCreatorRoleId")
                        .HasColumnType("uuid");

                    b.Property<short>("Rating")
                        .HasColumnType("smallint");

                    b.HasKey("Id");

                    b.HasIndex("AccountId");

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

                    b.HasIndex("PersonCreatorRoleId");

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

            modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountMedia", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<DateOnly>("Date")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("date")
                        .HasDefaultValueSql("now()");

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

                    b.Property<long>("ViewCount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasDefaultValue(0L);

                    b.HasKey("Id");

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

                    b.HasIndex("MediaId");

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

            modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountPerson", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<DateOnly>("Date")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("date")
                        .HasDefaultValueSql("now()");

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

                    b.Property<long>("ViewCount")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasDefaultValue(0L);

                    b.HasKey("Id");

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

                    b.HasIndex("PersonId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Account.Account", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.MediaPhotoImage", "BackgroundPicture")
                        .WithMany()
                        .HasForeignKey("BackgroundPictureId");

                    b.HasOne("WatchIt.Database.Model.Common.Gender", "Gender")
                        .WithMany()
                        .HasForeignKey("GenderId");

                    b.HasOne("WatchIt.Database.Model.Account.AccountProfilePicture", "ProfilePicture")
                        .WithOne("Account")
                        .HasForeignKey("WatchIt.Database.Model.Account.Account", "ProfilePictureId");

                    b.Navigation("BackgroundPicture");

                    b.Navigation("Gender");

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

            modelBuilder.Entity("WatchIt.Database.Model.Account.AccountRefreshToken", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Account.Account", "Account")
                        .WithMany("AccountRefreshTokens")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.Media", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.MediaPosterImage", "MediaPosterImage")
                        .WithOne("Media")
                        .HasForeignKey("WatchIt.Database.Model.Media.Media", "MediaPosterImageId");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaGenre", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Common.Genre", "Genre")
                        .WithMany("MediaGenres")
                        .HasForeignKey("GenreId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("MediaGenres")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Genre");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaMovie", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithOne()
                        .HasForeignKey("WatchIt.Database.Model.Media.MediaMovie", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("MediaPhotoImages")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.MediaPhotoImage", "MediaPhotoImage")
                        .WithOne("MediaPhotoImageBackground")
                        .HasForeignKey("WatchIt.Database.Model.Media.MediaPhotoImageBackground", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaProductionCountry", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Common.Country", "Country")
                        .WithMany("MediaProductionCountries")
                        .HasForeignKey("CountryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("MediaProductionCountries")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Country");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithOne()
                        .HasForeignKey("WatchIt.Database.Model.Media.MediaSeries", "Id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesEpisode", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.MediaSeriesSeason", "MediaSeriesSeason")
                        .WithMany("MediaSeriesEpisodes")
                        .HasForeignKey("MediaSeriesSeasonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesSeason", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.MediaSeries", "MediaSeries")
                        .WithMany("MediaSeriesSeasons")
                        .HasForeignKey("MediaSeriesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.Person", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Common.Gender", "Gender")
                        .WithMany()
                        .HasForeignKey("GenderId");

                    b.HasOne("WatchIt.Database.Model.Person.PersonPhotoImage", "PersonPhoto")
                        .WithOne("Person")
                        .HasForeignKey("WatchIt.Database.Model.Person.Person", "PersonPhotoId");

                    b.Navigation("Gender");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRole", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("PersonActorRoles")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Person.PersonActorRoleType", "PersonActorRoleType")
                        .WithMany()
                        .HasForeignKey("PersonActorRoleTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Person.Person", "Person")
                        .WithMany("PersonActorRoles")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Media");

                    b.Navigation("Person");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRole", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("PersonCreatorRoles")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Person.PersonCreatorRoleType", "PersonCreatorRoleType")
                        .WithMany()
                        .HasForeignKey("PersonCreatorRoleTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Person.Person", "Person")
                        .WithMany("PersonCreatorRoles")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Media");

                    b.Navigation("Person");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMedia", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Account.Account", "Account")
                        .WithMany("RatingMedia")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("RatingMedia")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesEpisode", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Account.Account", "Account")
                        .WithMany("RatingMediaSeriesEpisode")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Media.MediaSeriesEpisode", "MediaSeriesEpisode")
                        .WithMany("RatingMediaSeriesEpisode")
                        .HasForeignKey("MediaSeriesEpisodeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesSeason", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Account.Account", "Account")
                        .WithMany("RatingMediaSeriesSeason")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Media.MediaSeriesSeason", "MediaSeriesSeason")
                        .WithMany("RatingMediaSeriesSeason")
                        .HasForeignKey("MediaSeriesSeasonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonActorRole", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Account.Account", "Account")
                        .WithMany("RatingPersonActorRole")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Person.PersonActorRole", "PersonActorRole")
                        .WithMany("RatingPersonActorRole")
                        .HasForeignKey("PersonActorRoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

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

            modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonCreatorRole", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Account.Account", "Account")
                        .WithMany("RatingPersonCreatorRole")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("WatchIt.Database.Model.Person.PersonCreatorRole", "PersonCreatorRole")
                        .WithMany("RatingPersonCreatorRole")
                        .HasForeignKey("PersonCreatorRoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

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

            modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountMedia", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Media.Media", "Media")
                        .WithMany("ViewCountsMedia")
                        .HasForeignKey("MediaId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountPerson", b =>
                {
                    b.HasOne("WatchIt.Database.Model.Person.Person", "Person")
                        .WithMany("ViewCountsPerson")
                        .HasForeignKey("PersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("WatchIt.Database.Model.Account.Account", b =>
                {
                    b.Navigation("AccountRefreshTokens");

                    b.Navigation("RatingMedia");

                    b.Navigation("RatingMediaSeriesEpisode");

                    b.Navigation("RatingMediaSeriesSeason");

                    b.Navigation("RatingPersonActorRole");

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

            modelBuilder.Entity("WatchIt.Database.Model.Account.AccountProfilePicture", b =>
                {
                    b.Navigation("Account")
                        .IsRequired();
                });

            modelBuilder.Entity("WatchIt.Database.Model.Common.Country", b =>
                {
                    b.Navigation("MediaProductionCountries");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Common.Genre", b =>
                {
                    b.Navigation("MediaGenres");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Media.Media", b =>
                {
                    b.Navigation("MediaGenres");

                    b.Navigation("MediaPhotoImages");

                    b.Navigation("MediaProductionCountries");

                    b.Navigation("PersonActorRoles");

                    b.Navigation("PersonCreatorRoles");

                    b.Navigation("RatingMedia");

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

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b =>
                {
                    b.Navigation("MediaPhotoImageBackground");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b =>
                {
                    b.Navigation("Media")
                        .IsRequired();
                });

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b =>
                {
                    b.Navigation("MediaSeriesSeasons");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesEpisode", b =>
                {
                    b.Navigation("RatingMediaSeriesEpisode");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesSeason", b =>
                {
                    b.Navigation("MediaSeriesEpisodes");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.Person", b =>
                {
                    b.Navigation("PersonActorRoles");

                    b.Navigation("PersonCreatorRoles");

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

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRole", b =>
                {
                    b.Navigation("RatingPersonActorRole");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRole", b =>
                {
                    b.Navigation("RatingPersonCreatorRole");
                });

            modelBuilder.Entity("WatchIt.Database.Model.Person.PersonPhotoImage", b =>
                {
                    b.Navigation("Person")
                        .IsRequired();
                });
#pragma warning restore 612, 618
        }
    }
}
