Kyoo/back/src/Kyoo.Postgresql/Migrations/PostgresContextModelSnapshot.cs
2023-11-27 15:13:08 +01:00

1865 lines
74 KiB
C#

// <auto-generated />
using System;
using System.Collections.Generic;
using Kyoo.Abstractions.Models;
using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kyoo.Postgresql.Migrations
{
[DbContext(typeof(PostgresContext))]
partial class PostgresContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "genre", new[] { "action", "adventure", "animation", "comedy", "crime", "documentary", "drama", "family", "fantasy", "history", "horror", "music", "mystery", "romance", "science_fiction", "thriller", "war", "western" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "item_kind", new[] { "show", "movie", "collection" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "news_kind", new[] { "episode", "movie" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "status", new[] { "unknown", "finished", "airing", "planned" });
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Kyoo.Abstractions.Models.Collection", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.HasKey("Id")
.HasName("pk_collections");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_collections_slug");
b.ToTable("collections", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Episode", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("AbsoluteNumber")
.HasColumnType("integer")
.HasColumnName("absolute_number");
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<int?>("EpisodeNumber")
.HasColumnType("integer")
.HasColumnName("episode_number");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<string>("Name")
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("text")
.HasColumnName("path");
b.Property<DateTime?>("ReleaseDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("release_date");
b.Property<int>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");
b.Property<int?>("SeasonId")
.HasColumnType("integer")
.HasColumnName("season_id");
b.Property<int?>("SeasonNumber")
.HasColumnType("integer")
.HasColumnName("season_number");
b.Property<int>("ShowId")
.HasColumnType("integer")
.HasColumnName("show_id");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.HasKey("Id")
.HasName("pk_episodes");
b.HasIndex("SeasonId")
.HasDatabaseName("ix_episodes_season_id");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_episodes_slug");
b.HasIndex("ShowId", "SeasonNumber", "EpisodeNumber", "AbsoluteNumber")
.IsUnique()
.HasDatabaseName("ix_episodes_show_id_season_number_episode_number_absolute_numb");
b.ToTable("episodes", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.LibraryItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<DateTime?>("AirDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("air_date");
b.Property<string[]>("Aliases")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("aliases");
b.Property<DateTime?>("EndAir")
.HasColumnType("timestamp with time zone")
.HasColumnName("end_air");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<Genre[]>("Genres")
.IsRequired()
.HasColumnType("genre[]")
.HasColumnName("genres");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<string>("Path")
.HasColumnType("text")
.HasColumnName("path");
b.Property<int>("Rating")
.HasColumnType("integer")
.HasColumnName("rating");
b.Property<int?>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.Property<DateTime?>("StartAir")
.HasColumnType("timestamp with time zone")
.HasColumnName("start_air");
b.Property<Status>("Status")
.HasColumnType("status")
.HasColumnName("status");
b.Property<string>("Tagline")
.HasColumnType("text")
.HasColumnName("tagline");
b.Property<string[]>("Tags")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("tags");
b.Property<string>("Trailer")
.HasColumnType("text")
.HasColumnName("trailer");
b.HasKey("Id")
.HasName("pk_library_items");
b.ToTable("library_items", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Movie", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<DateTime?>("AirDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("air_date");
b.Property<string[]>("Aliases")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("aliases");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<Genre[]>("Genres")
.IsRequired()
.HasColumnType("genre[]")
.HasColumnName("genres");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("text")
.HasColumnName("path");
b.Property<int>("Rating")
.HasColumnType("integer")
.HasColumnName("rating");
b.Property<int>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.Property<Status>("Status")
.HasColumnType("status")
.HasColumnName("status");
b.Property<int?>("StudioId")
.HasColumnType("integer")
.HasColumnName("studio_id");
b.Property<string>("Tagline")
.HasColumnType("text")
.HasColumnName("tagline");
b.Property<string[]>("Tags")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("tags");
b.Property<string>("Trailer")
.HasColumnType("text")
.HasColumnName("trailer");
b.HasKey("Id")
.HasName("pk_movies");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_movies_slug");
b.HasIndex("StudioId")
.HasDatabaseName("ix_movies_studio_id");
b.ToTable("movies", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.News", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("AbsoluteNumber")
.HasColumnType("integer")
.HasColumnName("absolute_number");
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<DateTime?>("AirDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("air_date");
b.Property<string[]>("Aliases")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("aliases");
b.Property<int?>("EpisodeNumber")
.HasColumnType("integer")
.HasColumnName("episode_number");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<Genre[]>("Genres")
.IsRequired()
.HasColumnType("genre[]")
.HasColumnName("genres");
b.Property<string>("Name")
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("text")
.HasColumnName("path");
b.Property<int?>("Rating")
.HasColumnType("integer")
.HasColumnName("rating");
b.Property<int>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");
b.Property<int?>("SeasonNumber")
.HasColumnType("integer")
.HasColumnName("season_number");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.Property<Status?>("Status")
.HasColumnType("status")
.HasColumnName("status");
b.Property<string>("Tagline")
.HasColumnType("text")
.HasColumnName("tagline");
b.Property<string[]>("Tags")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("tags");
b.Property<string>("Trailer")
.HasColumnType("text")
.HasColumnName("trailer");
b.HasKey("Id")
.HasName("pk_news");
b.ToTable("news", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.People", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.HasKey("Id")
.HasName("pk_people");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_people_slug");
b.ToTable("people", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.PeopleRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("MovieID")
.HasColumnType("integer")
.HasColumnName("movie_id");
b.Property<int>("PeopleID")
.HasColumnType("integer")
.HasColumnName("people_id");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("text")
.HasColumnName("role");
b.Property<int?>("ShowID")
.HasColumnType("integer")
.HasColumnName("show_id");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text")
.HasColumnName("type");
b.HasKey("Id")
.HasName("pk_people_roles");
b.HasIndex("MovieID")
.HasDatabaseName("ix_people_roles_movie_id");
b.HasIndex("PeopleID")
.HasDatabaseName("ix_people_roles_people_id");
b.HasIndex("ShowID")
.HasDatabaseName("ix_people_roles_show_id");
b.ToTable("people_roles", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Season", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<DateTime?>("EndDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("end_date");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<string>("Name")
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<int>("SeasonNumber")
.HasColumnType("integer")
.HasColumnName("season_number");
b.Property<int>("ShowId")
.HasColumnType("integer")
.HasColumnName("show_id");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.Property<DateTime?>("StartDate")
.HasColumnType("timestamp with time zone")
.HasColumnName("start_date");
b.HasKey("Id")
.HasName("pk_seasons");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_seasons_slug");
b.HasIndex("ShowId", "SeasonNumber")
.IsUnique()
.HasDatabaseName("ix_seasons_show_id_season_number");
b.ToTable("seasons", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Show", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<List<string>>("Aliases")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("aliases");
b.Property<DateTime?>("EndAir")
.HasColumnType("timestamp with time zone")
.HasColumnName("end_air");
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<List<Genre>>("Genres")
.IsRequired()
.HasColumnType("genre[]")
.HasColumnName("genres");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Overview")
.HasColumnType("text")
.HasColumnName("overview");
b.Property<int>("Rating")
.HasColumnType("integer")
.HasColumnName("rating");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.Property<DateTime?>("StartAir")
.HasColumnType("timestamp with time zone")
.HasColumnName("start_air");
b.Property<Status>("Status")
.HasColumnType("status")
.HasColumnName("status");
b.Property<int?>("StudioId")
.HasColumnType("integer")
.HasColumnName("studio_id");
b.Property<string>("Tagline")
.HasColumnType("text")
.HasColumnName("tagline");
b.Property<List<string>>("Tags")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("tags");
b.Property<string>("Trailer")
.HasColumnType("text")
.HasColumnName("trailer");
b.HasKey("Id")
.HasName("pk_shows");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_shows_slug");
b.HasIndex("StudioId")
.HasDatabaseName("ix_shows_studio_id");
b.ToTable("shows", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Studio", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ExternalId")
.IsRequired()
.HasColumnType("json")
.HasColumnName("external_id");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.HasKey("Id")
.HasName("pk_studios");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_studios_slug");
b.ToTable("studios", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("AddedDate")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasColumnName("added_date")
.HasDefaultValueSql("now() at time zone 'utc'");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text")
.HasColumnName("email");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text")
.HasColumnName("password");
b.Property<string[]>("Permissions")
.IsRequired()
.HasColumnType("text[]")
.HasColumnName("permissions");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("slug");
b.Property<string>("Username")
.IsRequired()
.HasColumnType("text")
.HasColumnName("username");
b.HasKey("Id")
.HasName("pk_users");
b.HasIndex("Slug")
.IsUnique()
.HasDatabaseName("ix_users_slug");
b.ToTable("users", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.WatchedEpisode", b =>
{
b.Property<int>("UserID")
.HasColumnType("integer")
.HasColumnName("user_id");
b.Property<int>("EpisodeID")
.HasColumnType("integer")
.HasColumnName("episode_id");
b.Property<int>("WatchedPercentage")
.HasColumnType("integer")
.HasColumnName("watched_percentage");
b.HasKey("UserID", "EpisodeID")
.HasName("pk_watched_episode");
b.HasIndex("EpisodeID")
.HasDatabaseName("ix_watched_episode_episode_id");
b.ToTable("watched_episode", (string)null);
});
modelBuilder.Entity("ShowUser", b =>
{
b.Property<int>("UsersId")
.HasColumnType("integer")
.HasColumnName("users_id");
b.Property<int>("WatchedId")
.HasColumnType("integer")
.HasColumnName("watched_id");
b.HasKey("UsersId", "WatchedId")
.HasName("pk_link_user_show");
b.HasIndex("WatchedId")
.HasDatabaseName("ix_link_user_show_watched_id");
b.ToTable("link_user_show", (string)null);
});
modelBuilder.Entity("link_collection_movie", b =>
{
b.Property<int>("collection_id")
.HasColumnType("integer")
.HasColumnName("collection_id");
b.Property<int>("movie_id")
.HasColumnType("integer")
.HasColumnName("movie_id");
b.HasKey("collection_id", "movie_id")
.HasName("pk_link_collection_movie");
b.HasIndex("movie_id")
.HasDatabaseName("ix_link_collection_movie_movie_id");
b.ToTable("link_collection_movie", (string)null);
});
modelBuilder.Entity("link_collection_show", b =>
{
b.Property<int>("collection_id")
.HasColumnType("integer")
.HasColumnName("collection_id");
b.Property<int>("show_id")
.HasColumnType("integer")
.HasColumnName("show_id");
b.HasKey("collection_id", "show_id")
.HasName("pk_link_collection_show");
b.HasIndex("show_id")
.HasDatabaseName("ix_link_collection_show_show_id");
b.ToTable("link_collection_show", (string)null);
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Collection", b =>
{
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("CollectionId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("CollectionId");
b1.ToTable("collections");
b1.WithOwner()
.HasForeignKey("CollectionId")
.HasConstraintName("fk_collections_collections_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("CollectionId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("CollectionId");
b1.ToTable("collections");
b1.WithOwner()
.HasForeignKey("CollectionId")
.HasConstraintName("fk_collections_collections_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("CollectionId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("CollectionId");
b1.ToTable("collections");
b1.WithOwner()
.HasForeignKey("CollectionId")
.HasConstraintName("fk_collections_collections_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Episode", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Season", "Season")
.WithMany("Episodes")
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_episodes_seasons_season_id");
b.HasOne("Kyoo.Abstractions.Models.Show", "Show")
.WithMany("Episodes")
.HasForeignKey("ShowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_episodes_shows_show_id");
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("EpisodeId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("EpisodeId");
b1.ToTable("episodes");
b1.WithOwner()
.HasForeignKey("EpisodeId")
.HasConstraintName("fk_episodes_episodes_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("EpisodeId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("EpisodeId");
b1.ToTable("episodes");
b1.WithOwner()
.HasForeignKey("EpisodeId")
.HasConstraintName("fk_episodes_episodes_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("EpisodeId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("EpisodeId");
b1.ToTable("episodes");
b1.WithOwner()
.HasForeignKey("EpisodeId")
.HasConstraintName("fk_episodes_episodes_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Season");
b.Navigation("Show");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.LibraryItem", b =>
{
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("LibraryItemId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("LibraryItemId");
b1.ToTable("library_items");
b1.WithOwner()
.HasForeignKey("LibraryItemId")
.HasConstraintName("fk_library_items_library_items_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("LibraryItemId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("LibraryItemId");
b1.ToTable("library_items");
b1.WithOwner()
.HasForeignKey("LibraryItemId")
.HasConstraintName("fk_library_items_library_items_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("LibraryItemId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("LibraryItemId");
b1.ToTable("library_items");
b1.WithOwner()
.HasForeignKey("LibraryItemId")
.HasConstraintName("fk_library_items_library_items_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Movie", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Studio", "Studio")
.WithMany("Movies")
.HasForeignKey("StudioId")
.OnDelete(DeleteBehavior.SetNull)
.HasConstraintName("fk_movies_studios_studio_id");
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("MovieId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("MovieId");
b1.ToTable("movies");
b1.WithOwner()
.HasForeignKey("MovieId")
.HasConstraintName("fk_movies_movies_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("MovieId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("MovieId");
b1.ToTable("movies");
b1.WithOwner()
.HasForeignKey("MovieId")
.HasConstraintName("fk_movies_movies_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("MovieId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("MovieId");
b1.ToTable("movies");
b1.WithOwner()
.HasForeignKey("MovieId")
.HasConstraintName("fk_movies_movies_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Studio");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.News", b =>
{
b.OwnsOne("Kyoo.Abstractions.Models.News+ShowInfo", "Show", b1 =>
{
b1.Property<int>("NewsId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<int>("Id")
.HasColumnType("integer")
.HasColumnName("show_id");
b1.Property<string>("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("show_name");
b1.Property<string>("Slug")
.IsRequired()
.HasColumnType("text")
.HasColumnName("show_slug");
b1.HasKey("NewsId");
b1.ToTable("news");
b1.WithOwner()
.HasForeignKey("NewsId")
.HasConstraintName("fk_news_news_id");
b1.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b2 =>
{
b2.Property<int>("ShowInfoNewsId")
.HasColumnType("integer")
.HasColumnName("id");
b2.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("show_logo_blurhash");
b2.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("show_logo_source");
b2.HasKey("ShowInfoNewsId");
b2.ToTable("news");
b2.WithOwner()
.HasForeignKey("ShowInfoNewsId")
.HasConstraintName("fk_news_news_id");
});
b1.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b2 =>
{
b2.Property<int>("ShowInfoNewsId")
.HasColumnType("integer")
.HasColumnName("id");
b2.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("show_poster_blurhash");
b2.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("show_poster_source");
b2.HasKey("ShowInfoNewsId");
b2.ToTable("news");
b2.WithOwner()
.HasForeignKey("ShowInfoNewsId")
.HasConstraintName("fk_news_news_id");
});
b1.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b2 =>
{
b2.Property<int>("ShowInfoNewsId")
.HasColumnType("integer")
.HasColumnName("id");
b2.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("show_thumbnail_blurhash");
b2.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("show_thumbnail_source");
b2.HasKey("ShowInfoNewsId");
b2.ToTable("news");
b2.WithOwner()
.HasForeignKey("ShowInfoNewsId")
.HasConstraintName("fk_news_news_id");
});
b1.Navigation("Logo");
b1.Navigation("Poster");
b1.Navigation("Thumbnail");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("NewsId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("NewsId");
b1.ToTable("news");
b1.WithOwner()
.HasForeignKey("NewsId")
.HasConstraintName("fk_news_news_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("NewsId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("NewsId");
b1.ToTable("news");
b1.WithOwner()
.HasForeignKey("NewsId")
.HasConstraintName("fk_news_news_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("NewsId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("NewsId");
b1.ToTable("news");
b1.WithOwner()
.HasForeignKey("NewsId")
.HasConstraintName("fk_news_news_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Show");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.People", b =>
{
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("PeopleId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("PeopleId");
b1.ToTable("people");
b1.WithOwner()
.HasForeignKey("PeopleId")
.HasConstraintName("fk_people_people_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("PeopleId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("PeopleId");
b1.ToTable("people");
b1.WithOwner()
.HasForeignKey("PeopleId")
.HasConstraintName("fk_people_people_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("PeopleId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("PeopleId");
b1.ToTable("people");
b1.WithOwner()
.HasForeignKey("PeopleId")
.HasConstraintName("fk_people_people_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.PeopleRole", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Movie", "Movie")
.WithMany("People")
.HasForeignKey("MovieID")
.HasConstraintName("fk_people_roles_movies_movie_id");
b.HasOne("Kyoo.Abstractions.Models.People", "People")
.WithMany("Roles")
.HasForeignKey("PeopleID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_people_roles_people_people_id");
b.HasOne("Kyoo.Abstractions.Models.Show", "Show")
.WithMany("People")
.HasForeignKey("ShowID")
.HasConstraintName("fk_people_roles_shows_show_id");
b.Navigation("Movie");
b.Navigation("People");
b.Navigation("Show");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Season", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Show", "Show")
.WithMany("Seasons")
.HasForeignKey("ShowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_seasons_shows_show_id");
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("SeasonId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("SeasonId");
b1.ToTable("seasons");
b1.WithOwner()
.HasForeignKey("SeasonId")
.HasConstraintName("fk_seasons_seasons_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("SeasonId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("SeasonId");
b1.ToTable("seasons");
b1.WithOwner()
.HasForeignKey("SeasonId")
.HasConstraintName("fk_seasons_seasons_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("SeasonId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("SeasonId");
b1.ToTable("seasons");
b1.WithOwner()
.HasForeignKey("SeasonId")
.HasConstraintName("fk_seasons_seasons_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Show");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Show", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Studio", "Studio")
.WithMany("Shows")
.HasForeignKey("StudioId")
.OnDelete(DeleteBehavior.SetNull)
.HasConstraintName("fk_shows_studios_studio_id");
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("ShowId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("ShowId");
b1.ToTable("shows");
b1.WithOwner()
.HasForeignKey("ShowId")
.HasConstraintName("fk_shows_shows_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Poster", b1 =>
{
b1.Property<int>("ShowId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("poster_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("poster_source");
b1.HasKey("ShowId");
b1.ToTable("shows");
b1.WithOwner()
.HasForeignKey("ShowId")
.HasConstraintName("fk_shows_shows_id");
});
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Thumbnail", b1 =>
{
b1.Property<int>("ShowId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("thumbnail_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("thumbnail_source");
b1.HasKey("ShowId");
b1.ToTable("shows");
b1.WithOwner()
.HasForeignKey("ShowId")
.HasConstraintName("fk_shows_shows_id");
});
b.Navigation("Logo");
b.Navigation("Poster");
b.Navigation("Studio");
b.Navigation("Thumbnail");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.User", b =>
{
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
{
b1.Property<int>("UserId")
.HasColumnType("integer")
.HasColumnName("id");
b1.Property<string>("Blurhash")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("logo_blurhash");
b1.Property<string>("Source")
.IsRequired()
.HasColumnType("text")
.HasColumnName("logo_source");
b1.HasKey("UserId");
b1.ToTable("users");
b1.WithOwner()
.HasForeignKey("UserId")
.HasConstraintName("fk_users_users_id");
});
b.Navigation("Logo");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.WatchedEpisode", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Episode", "Episode")
.WithMany()
.HasForeignKey("EpisodeID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_watched_episode_episodes_episode_id");
b.HasOne("Kyoo.Abstractions.Models.User", null)
.WithMany("CurrentlyWatching")
.HasForeignKey("UserID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_watched_episode_users_user_id");
b.Navigation("Episode");
});
modelBuilder.Entity("ShowUser", b =>
{
b.HasOne("Kyoo.Abstractions.Models.User", null)
.WithMany()
.HasForeignKey("UsersId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_link_user_show_users_users_id");
b.HasOne("Kyoo.Abstractions.Models.Show", null)
.WithMany()
.HasForeignKey("WatchedId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_link_user_show_shows_watched_id");
});
modelBuilder.Entity("link_collection_movie", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Collection", null)
.WithMany()
.HasForeignKey("collection_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_link_collection_movie_collections_collection_id");
b.HasOne("Kyoo.Abstractions.Models.Movie", null)
.WithMany()
.HasForeignKey("movie_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_link_collection_movie_movies_movie_id");
});
modelBuilder.Entity("link_collection_show", b =>
{
b.HasOne("Kyoo.Abstractions.Models.Collection", null)
.WithMany()
.HasForeignKey("collection_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_link_collection_show_collections_collection_id");
b.HasOne("Kyoo.Abstractions.Models.Show", null)
.WithMany()
.HasForeignKey("show_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_link_collection_show_shows_show_id");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Movie", b =>
{
b.Navigation("People");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.People", b =>
{
b.Navigation("Roles");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Season", b =>
{
b.Navigation("Episodes");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Show", b =>
{
b.Navigation("Episodes");
b.Navigation("People");
b.Navigation("Seasons");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.Studio", b =>
{
b.Navigation("Movies");
b.Navigation("Shows");
});
modelBuilder.Entity("Kyoo.Abstractions.Models.User", b =>
{
b.Navigation("CurrentlyWatching");
});
#pragma warning restore 612, 618
}
}
}