Kyoo/Kyoo.SqLite/Migrations/20210613135157_Initial.Designer.cs
2021-06-13 18:21:05 +02:00

968 lines
31 KiB
C#

// <auto-generated />
using System;
using Kyoo.SqLite;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Kyoo.SqLite.Migrations
{
[DbContext(typeof(SqLiteContext))]
[Migration("20210613135157_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.7");
modelBuilder.Entity("Kyoo.Models.Collection", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Overview")
.HasColumnType("TEXT");
b.Property<string>("Poster")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("Collections");
});
modelBuilder.Entity("Kyoo.Models.Episode", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("AbsoluteNumber")
.HasColumnType("INTEGER");
b.Property<int>("EpisodeNumber")
.HasColumnType("INTEGER");
b.Property<string>("Overview")
.HasColumnType("TEXT");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<DateTime?>("ReleaseDate")
.HasColumnType("TEXT");
b.Property<int?>("SeasonID")
.HasColumnType("INTEGER");
b.Property<int>("SeasonNumber")
.HasColumnType("INTEGER");
b.Property<int>("ShowID")
.HasColumnType("INTEGER");
b.Property<string>("Slug")
.HasColumnType("TEXT");
b.Property<string>("Thumb")
.HasColumnType("TEXT");
b.Property<string>("Title")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("SeasonID");
b.HasIndex("ShowID", "SeasonNumber", "EpisodeNumber", "AbsoluteNumber")
.IsUnique();
b.ToTable("Episodes");
});
modelBuilder.Entity("Kyoo.Models.Genre", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("Genres");
});
modelBuilder.Entity("Kyoo.Models.Library", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Paths")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("Libraries");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Collection, Kyoo.Models.Show>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("Link<Collection, Show>");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Library, Kyoo.Models.Collection>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("Link<Library, Collection>");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Library, Kyoo.Models.Provider>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("Link<Library, Provider>");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Library, Kyoo.Models.Show>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("Link<Library, Show>");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Show, Kyoo.Models.Genre>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("Link<Show, Genre>");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.User, Kyoo.Models.Show>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("Link<User, Show>");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.Episode>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.Property<string>("DataID")
.HasColumnType("TEXT");
b.Property<string>("Link")
.HasColumnType("TEXT");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("MetadataID<Episode>");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.People>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.Property<string>("DataID")
.HasColumnType("TEXT");
b.Property<string>("Link")
.HasColumnType("TEXT");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("MetadataID<People>");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.Season>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.Property<string>("DataID")
.HasColumnType("TEXT");
b.Property<string>("Link")
.HasColumnType("TEXT");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("MetadataID<Season>");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.Show>", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.Property<string>("DataID")
.HasColumnType("TEXT");
b.Property<string>("Link")
.HasColumnType("TEXT");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("MetadataID<Show>");
});
modelBuilder.Entity("Kyoo.Models.People", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Poster")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("People");
});
modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<bool>("ForPeople")
.HasColumnType("INTEGER");
b.Property<int>("PeopleID")
.HasColumnType("INTEGER");
b.Property<string>("Role")
.HasColumnType("TEXT");
b.Property<int>("ShowID")
.HasColumnType("INTEGER");
b.Property<string>("Type")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PeopleID");
b.HasIndex("ShowID");
b.ToTable("PeopleRoles");
});
modelBuilder.Entity("Kyoo.Models.Provider", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Logo")
.HasColumnType("TEXT");
b.Property<string>("LogoExtension")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("Providers");
});
modelBuilder.Entity("Kyoo.Models.Season", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime?>("EndDate")
.HasColumnType("TEXT");
b.Property<string>("Overview")
.HasColumnType("TEXT");
b.Property<string>("Poster")
.HasColumnType("TEXT");
b.Property<int>("SeasonNumber")
.HasColumnType("INTEGER");
b.Property<int>("ShowID")
.HasColumnType("INTEGER");
b.Property<string>("Slug")
.HasColumnType("TEXT");
b.Property<DateTime?>("StartDate")
.HasColumnType("TEXT");
b.Property<string>("Title")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ShowID", "SeasonNumber")
.IsUnique();
b.ToTable("Seasons");
});
modelBuilder.Entity("Kyoo.Models.Show", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Aliases")
.HasColumnType("TEXT");
b.Property<string>("Backdrop")
.HasColumnType("TEXT");
b.Property<DateTime?>("EndAir")
.HasColumnType("TEXT");
b.Property<bool>("IsMovie")
.HasColumnType("INTEGER");
b.Property<string>("Logo")
.HasColumnType("TEXT");
b.Property<string>("Overview")
.HasColumnType("TEXT");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("Poster")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime?>("StartAir")
.HasColumnType("TEXT");
b.Property<int?>("Status")
.HasColumnType("INTEGER");
b.Property<int?>("StudioID")
.HasColumnType("INTEGER");
b.Property<string>("Title")
.HasColumnType("TEXT");
b.Property<string>("TrailerUrl")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.HasIndex("StudioID");
b.ToTable("Shows");
});
modelBuilder.Entity("Kyoo.Models.Studio", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("Studios");
});
modelBuilder.Entity("Kyoo.Models.Track", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Codec")
.HasColumnType("TEXT");
b.Property<int>("EpisodeID")
.HasColumnType("INTEGER");
b.Property<bool>("IsDefault")
.HasColumnType("INTEGER");
b.Property<bool>("IsExternal")
.HasColumnType("INTEGER");
b.Property<bool>("IsForced")
.HasColumnType("INTEGER");
b.Property<string>("Language")
.HasColumnType("TEXT");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.HasColumnType("TEXT");
b.Property<string>("Title")
.HasColumnType("TEXT");
b.Property<int>("TrackIndex")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("EpisodeID", "Type", "Language", "TrackIndex", "IsForced")
.IsUnique();
b.ToTable("Tracks");
});
modelBuilder.Entity("Kyoo.Models.User", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Email")
.HasColumnType("TEXT");
b.Property<string>("ExtraData")
.HasColumnType("TEXT");
b.Property<string>("Password")
.HasColumnType("TEXT");
b.Property<string>("Permissions")
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Username")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("Slug")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("Kyoo.Models.WatchedEpisode", b =>
{
b.Property<int>("FirstID")
.HasColumnType("INTEGER");
b.Property<int>("SecondID")
.HasColumnType("INTEGER");
b.Property<int>("WatchedPercentage")
.HasColumnType("INTEGER");
b.HasKey("FirstID", "SecondID");
b.HasIndex("SecondID");
b.ToTable("WatchedEpisodes");
});
modelBuilder.Entity("Kyoo.Models.Episode", b =>
{
b.HasOne("Kyoo.Models.Season", "Season")
.WithMany("Episodes")
.HasForeignKey("SeasonID");
b.HasOne("Kyoo.Models.Show", "Show")
.WithMany("Episodes")
.HasForeignKey("ShowID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Season");
b.Navigation("Show");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Collection, Kyoo.Models.Show>", b =>
{
b.HasOne("Kyoo.Models.Collection", "First")
.WithMany("ShowLinks")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Show", "Second")
.WithMany("CollectionLinks")
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Library, Kyoo.Models.Collection>", b =>
{
b.HasOne("Kyoo.Models.Library", "First")
.WithMany("CollectionLinks")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Collection", "Second")
.WithMany("LibraryLinks")
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Library, Kyoo.Models.Provider>", b =>
{
b.HasOne("Kyoo.Models.Library", "First")
.WithMany("ProviderLinks")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Provider", "Second")
.WithMany("LibraryLinks")
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Library, Kyoo.Models.Show>", b =>
{
b.HasOne("Kyoo.Models.Library", "First")
.WithMany("ShowLinks")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Show", "Second")
.WithMany("LibraryLinks")
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.Show, Kyoo.Models.Genre>", b =>
{
b.HasOne("Kyoo.Models.Show", "First")
.WithMany("GenreLinks")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Genre", "Second")
.WithMany("ShowLinks")
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.Link<Kyoo.Models.User, Kyoo.Models.Show>", b =>
{
b.HasOne("Kyoo.Models.User", "First")
.WithMany("ShowLinks")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Show", "Second")
.WithMany()
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.Episode>", b =>
{
b.HasOne("Kyoo.Models.Episode", "First")
.WithMany("ExternalIDs")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Provider", "Second")
.WithMany()
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.People>", b =>
{
b.HasOne("Kyoo.Models.People", "First")
.WithMany("ExternalIDs")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Provider", "Second")
.WithMany()
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.Season>", b =>
{
b.HasOne("Kyoo.Models.Season", "First")
.WithMany("ExternalIDs")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Provider", "Second")
.WithMany()
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.MetadataID<Kyoo.Models.Show>", b =>
{
b.HasOne("Kyoo.Models.Show", "First")
.WithMany("ExternalIDs")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Provider", "Second")
.WithMany()
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
{
b.HasOne("Kyoo.Models.People", "People")
.WithMany("Roles")
.HasForeignKey("PeopleID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Show", "Show")
.WithMany("People")
.HasForeignKey("ShowID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("People");
b.Navigation("Show");
});
modelBuilder.Entity("Kyoo.Models.Season", b =>
{
b.HasOne("Kyoo.Models.Show", "Show")
.WithMany("Seasons")
.HasForeignKey("ShowID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Show");
});
modelBuilder.Entity("Kyoo.Models.Show", b =>
{
b.HasOne("Kyoo.Models.Studio", "Studio")
.WithMany("Shows")
.HasForeignKey("StudioID");
b.Navigation("Studio");
});
modelBuilder.Entity("Kyoo.Models.Track", b =>
{
b.HasOne("Kyoo.Models.Episode", "Episode")
.WithMany("Tracks")
.HasForeignKey("EpisodeID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Episode");
});
modelBuilder.Entity("Kyoo.Models.WatchedEpisode", b =>
{
b.HasOne("Kyoo.Models.User", "First")
.WithMany("CurrentlyWatching")
.HasForeignKey("FirstID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kyoo.Models.Episode", "Second")
.WithMany()
.HasForeignKey("SecondID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("First");
b.Navigation("Second");
});
modelBuilder.Entity("Kyoo.Models.Collection", b =>
{
b.Navigation("LibraryLinks");
b.Navigation("ShowLinks");
});
modelBuilder.Entity("Kyoo.Models.Episode", b =>
{
b.Navigation("ExternalIDs");
b.Navigation("Tracks");
});
modelBuilder.Entity("Kyoo.Models.Genre", b =>
{
b.Navigation("ShowLinks");
});
modelBuilder.Entity("Kyoo.Models.Library", b =>
{
b.Navigation("CollectionLinks");
b.Navigation("ProviderLinks");
b.Navigation("ShowLinks");
});
modelBuilder.Entity("Kyoo.Models.People", b =>
{
b.Navigation("ExternalIDs");
b.Navigation("Roles");
});
modelBuilder.Entity("Kyoo.Models.Provider", b =>
{
b.Navigation("LibraryLinks");
});
modelBuilder.Entity("Kyoo.Models.Season", b =>
{
b.Navigation("Episodes");
b.Navigation("ExternalIDs");
});
modelBuilder.Entity("Kyoo.Models.Show", b =>
{
b.Navigation("CollectionLinks");
b.Navigation("Episodes");
b.Navigation("ExternalIDs");
b.Navigation("GenreLinks");
b.Navigation("LibraryLinks");
b.Navigation("People");
b.Navigation("Seasons");
});
modelBuilder.Entity("Kyoo.Models.Studio", b =>
{
b.Navigation("Shows");
});
modelBuilder.Entity("Kyoo.Models.User", b =>
{
b.Navigation("CurrentlyWatching");
b.Navigation("ShowLinks");
});
#pragma warning restore 612, 618
}
}
}