mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fixing the database context
This commit is contained in:
parent
0fa18bfa87
commit
733a844508
@ -15,7 +15,7 @@ namespace Kyoo.Models
|
|||||||
public string Overview { get; set; }
|
public string Overview { get; set; }
|
||||||
public int? Year { get; set; }
|
public int? Year { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public string ImgPrimary { get; set; }
|
[JsonIgnore] public string Poster { get; set; }
|
||||||
public virtual IEnumerable<MetadataID> ExternalIDs { get; set; }
|
public virtual IEnumerable<MetadataID> ExternalIDs { get; set; }
|
||||||
|
|
||||||
[JsonIgnore] public virtual Show Show { get; set; }
|
[JsonIgnore] public virtual Show Show { get; set; }
|
||||||
@ -28,7 +28,7 @@ namespace Kyoo.Models
|
|||||||
string title,
|
string title,
|
||||||
string overview,
|
string overview,
|
||||||
int? year,
|
int? year,
|
||||||
string imgPrimary,
|
string poster,
|
||||||
IEnumerable<MetadataID> externalIDs)
|
IEnumerable<MetadataID> externalIDs)
|
||||||
{
|
{
|
||||||
ShowID = showID;
|
ShowID = showID;
|
||||||
@ -36,7 +36,7 @@ namespace Kyoo.Models
|
|||||||
Title = title;
|
Title = title;
|
||||||
Overview = overview;
|
Overview = overview;
|
||||||
Year = year;
|
Year = year;
|
||||||
ImgPrimary = imgPrimary;
|
Poster = poster;
|
||||||
ExternalIDs = externalIDs;
|
ExternalIDs = externalIDs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,11 +82,11 @@ namespace Kyoo.Controllers
|
|||||||
if (season?.Show?.Path == null)
|
if (season?.Show?.Path == null)
|
||||||
return default;
|
return default;
|
||||||
|
|
||||||
if (season.ImgPrimary != null)
|
if (season.Poster != null)
|
||||||
{
|
{
|
||||||
string localPath = Path.Combine(season.Show.Path, $"season-{season.SeasonNumber}.jpg");
|
string localPath = Path.Combine(season.Show.Path, $"season-{season.SeasonNumber}.jpg");
|
||||||
if (alwaysDownload || !File.Exists(localPath))
|
if (alwaysDownload || !File.Exists(localPath))
|
||||||
await DownloadImage(season.ImgPrimary, localPath, $"The poster of {season.Show.Title}'s season {season.SeasonNumber}");
|
await DownloadImage(season.Poster, localPath, $"The poster of {season.Show.Title}'s season {season.SeasonNumber}");
|
||||||
}
|
}
|
||||||
return season;
|
return season;
|
||||||
}
|
}
|
||||||
|
@ -55,17 +55,21 @@ namespace Kyoo
|
|||||||
modelBuilder.HasPostgresEnum<ItemType>();
|
modelBuilder.HasPostgresEnum<ItemType>();
|
||||||
modelBuilder.HasPostgresEnum<StreamType>();
|
modelBuilder.HasPostgresEnum<StreamType>();
|
||||||
|
|
||||||
modelBuilder.Entity<Library>()
|
modelBuilder.Ignore<Library>();
|
||||||
|
modelBuilder.Ignore<Collection>();
|
||||||
|
modelBuilder.Ignore<Show>();
|
||||||
|
modelBuilder.Ignore<Genre>();
|
||||||
|
|
||||||
|
modelBuilder.Entity<LibraryDE>()
|
||||||
.Property(x => x.Paths)
|
.Property(x => x.Paths)
|
||||||
.HasColumnType("text[]")
|
.HasColumnType("text[]")
|
||||||
.Metadata.SetValueComparer(_stringArrayComparer);
|
.Metadata.SetValueComparer(_stringArrayComparer);
|
||||||
|
|
||||||
modelBuilder.Entity<Show>()
|
modelBuilder.Entity<ShowDE>()
|
||||||
.Property(x => x.Aliases)
|
.Property(x => x.Aliases)
|
||||||
.HasColumnType("text[]")
|
.HasColumnType("text[]")
|
||||||
.Metadata.SetValueComparer(_stringArrayComparer);
|
.Metadata.SetValueComparer(_stringArrayComparer);
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<Track>()
|
modelBuilder.Entity<Track>()
|
||||||
.Property(t => t.IsDefault)
|
.Property(t => t.IsDefault)
|
||||||
.ValueGeneratedNever();
|
.ValueGeneratedNever();
|
||||||
@ -77,16 +81,16 @@ namespace Kyoo
|
|||||||
modelBuilder.Entity<GenreLink>()
|
modelBuilder.Entity<GenreLink>()
|
||||||
.HasKey(x => new {x.ShowID, x.GenreID});
|
.HasKey(x => new {x.ShowID, x.GenreID});
|
||||||
|
|
||||||
modelBuilder.Entity<Library>()
|
modelBuilder.Entity<LibraryDE>()
|
||||||
.Ignore(x => x.Shows)
|
.Ignore(x => x.Shows)
|
||||||
.Ignore(x => x.Collections)
|
.Ignore(x => x.Collections)
|
||||||
.Ignore(x => x.Providers);
|
.Ignore(x => x.Providers);
|
||||||
|
|
||||||
modelBuilder.Entity<Collection>()
|
modelBuilder.Entity<CollectionDE>()
|
||||||
.Ignore(x => x.Shows)
|
.Ignore(x => x.Shows)
|
||||||
.Ignore(x => x.Libraries);
|
.Ignore(x => x.Libraries);
|
||||||
|
|
||||||
modelBuilder.Entity<Show>()
|
modelBuilder.Entity<ShowDE>()
|
||||||
.Ignore(x => x.Genres)
|
.Ignore(x => x.Genres)
|
||||||
.Ignore(x => x.Libraries)
|
.Ignore(x => x.Libraries)
|
||||||
.Ignore(x => x.Collections);
|
.Ignore(x => x.Collections);
|
||||||
@ -97,12 +101,52 @@ namespace Kyoo
|
|||||||
.Ignore(x => x.Poster)
|
.Ignore(x => x.Poster)
|
||||||
.Ignore(x => x.ExternalIDs);
|
.Ignore(x => x.ExternalIDs);
|
||||||
|
|
||||||
modelBuilder.Entity<Genre>()
|
modelBuilder.Entity<GenreDE>()
|
||||||
.Ignore(x => x.Shows);
|
.Ignore(x => x.Shows);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
modelBuilder.Entity<LibraryLink>()
|
||||||
|
.HasOne(x => x.Library as LibraryDE)
|
||||||
|
.WithMany(x => x.Links);
|
||||||
|
modelBuilder.Entity<LibraryLink>()
|
||||||
|
.HasOne(x => x.Show as ShowDE)
|
||||||
|
.WithMany(x => x.LibraryLinks);
|
||||||
|
modelBuilder.Entity<LibraryLink>()
|
||||||
|
.HasOne(x => x.Collection as CollectionDE)
|
||||||
|
.WithMany(x => x.LibraryLinks);
|
||||||
|
|
||||||
|
modelBuilder.Entity<CollectionLink>()
|
||||||
|
.HasOne(x => x.Collection as CollectionDE)
|
||||||
|
.WithMany(x => x.Links);
|
||||||
|
modelBuilder.Entity<CollectionLink>()
|
||||||
|
.HasOne(x => x.Show as ShowDE)
|
||||||
|
.WithMany(x => x.CollectionLinks);
|
||||||
|
|
||||||
|
modelBuilder.Entity<GenreLink>()
|
||||||
|
.HasOne(x => x.Genre as GenreDE)
|
||||||
|
.WithMany(x => x.Links);
|
||||||
|
modelBuilder.Entity<GenreLink>()
|
||||||
|
.HasOne(x => x.Show as ShowDE)
|
||||||
|
.WithMany(x => x.GenreLinks);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ProviderLink>()
|
||||||
|
.HasOne(x => x.Library as LibraryDE)
|
||||||
|
.WithMany(x => x.ProviderLinks);
|
||||||
|
|
||||||
|
modelBuilder.Entity<Season>()
|
||||||
|
.HasOne(x => x.Show as ShowDE)
|
||||||
|
.WithMany(x => x.Seasons);
|
||||||
|
modelBuilder.Entity<Episode>()
|
||||||
|
.HasOne(x => x.Show as ShowDE)
|
||||||
|
.WithMany(x => x.Episodes);
|
||||||
|
modelBuilder.Entity<PeopleRole>()
|
||||||
|
.HasOne(x => x.Show as ShowDE)
|
||||||
|
.WithMany(x => x.People);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<MetadataID>()
|
modelBuilder.Entity<MetadataID>()
|
||||||
.HasOne(x => x.Show)
|
.HasOne(x => x.Show as ShowDE)
|
||||||
.WithMany(x => x.ExternalIDs)
|
.WithMany(x => x.ExternalIDs)
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
modelBuilder.Entity<MetadataID>()
|
modelBuilder.Entity<MetadataID>()
|
||||||
@ -118,20 +162,27 @@ namespace Kyoo
|
|||||||
.WithMany(x => x.ExternalIDs)
|
.WithMany(x => x.ExternalIDs)
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
|
modelBuilder.Entity<CollectionDE>().Property(x => x.Slug).IsRequired();
|
||||||
|
modelBuilder.Entity<GenreDE>().Property(x => x.Slug).IsRequired();
|
||||||
|
modelBuilder.Entity<LibraryDE>().Property(x => x.Slug).IsRequired();
|
||||||
|
modelBuilder.Entity<People>().Property(x => x.Slug).IsRequired();
|
||||||
|
modelBuilder.Entity<ProviderID>().Property(x => x.Slug).IsRequired();
|
||||||
|
modelBuilder.Entity<ShowDE>().Property(x => x.Slug).IsRequired();
|
||||||
|
modelBuilder.Entity<Studio>().Property(x => x.Slug).IsRequired();
|
||||||
|
|
||||||
modelBuilder.Entity<Collection>()
|
modelBuilder.Entity<CollectionDE>()
|
||||||
.HasIndex(x => x.Slug)
|
.HasIndex(x => x.Slug)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
modelBuilder.Entity<Genre>()
|
modelBuilder.Entity<GenreDE>()
|
||||||
.HasIndex(x => x.Slug)
|
.HasIndex(x => x.Slug)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
modelBuilder.Entity<Library>()
|
modelBuilder.Entity<LibraryDE>()
|
||||||
.HasIndex(x => x.Slug)
|
.HasIndex(x => x.Slug)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
modelBuilder.Entity<People>()
|
modelBuilder.Entity<People>()
|
||||||
.HasIndex(x => x.Slug)
|
.HasIndex(x => x.Slug)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
modelBuilder.Entity<Show>()
|
modelBuilder.Entity<ShowDE>()
|
||||||
.HasIndex(x => x.Slug)
|
.HasIndex(x => x.Slug)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
modelBuilder.Entity<Studio>()
|
modelBuilder.Entity<Studio>()
|
||||||
|
@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace Kyoo.Models.DatabaseMigrations.Internal
|
namespace Kyoo.Models.DatabaseMigrations.Internal
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DatabaseContext))]
|
[DbContext(typeof(DatabaseContext))]
|
||||||
[Migration("20200815231223_Initial")]
|
[Migration("20200816150752_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@ -25,17 +25,13 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasAnnotation("ProductVersion", "3.1.3")
|
.HasAnnotation("ProductVersion", "3.1.3")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Collection", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
@ -46,6 +42,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -53,9 +50,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Collection");
|
b.ToTable("Collections");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Collection");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
||||||
@ -65,24 +62,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int?>("CollectionDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("CollectionID")
|
b.Property<int?>("CollectionID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("ShowDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("ShowID")
|
b.Property<int>("ShowID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowID");
|
b.HasIndex("ShowID");
|
||||||
|
|
||||||
b.HasIndex("CollectionID", "ShowID")
|
b.HasIndex("CollectionID", "ShowID")
|
||||||
@ -141,21 +128,18 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("Episodes");
|
b.ToTable("Episodes");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Genre", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -163,9 +147,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Genre");
|
b.ToTable("Genres");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Genre");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
@ -176,34 +160,20 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.Property<int>("GenreID")
|
b.Property<int>("GenreID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("GenreDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("ShowDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("ShowID", "GenreID");
|
b.HasKey("ShowID", "GenreID");
|
||||||
|
|
||||||
b.HasIndex("GenreDEID");
|
|
||||||
|
|
||||||
b.HasIndex("GenreID");
|
b.HasIndex("GenreID");
|
||||||
|
|
||||||
b.HasIndex("ShowDEID");
|
|
||||||
|
|
||||||
b.ToTable("GenreLinks");
|
b.ToTable("GenreLinks");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Library", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
@ -211,6 +181,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text[]");
|
.HasColumnType("text[]");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -218,9 +189,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Library");
|
b.ToTable("Libraries");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Library");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
@ -230,34 +201,19 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int?>("CollectionDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("CollectionID")
|
b.Property<int?>("CollectionID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("LibraryDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("LibraryID")
|
b.Property<int>("LibraryID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("ShowDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("ShowID")
|
b.Property<int?>("ShowID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasIndex("CollectionID");
|
b.HasIndex("CollectionID");
|
||||||
|
|
||||||
b.HasIndex("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowID");
|
b.HasIndex("ShowID");
|
||||||
|
|
||||||
b.HasIndex("LibraryID", "CollectionID")
|
b.HasIndex("LibraryID", "CollectionID")
|
||||||
@ -326,6 +282,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -378,6 +335,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -395,9 +353,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int?>("LibraryDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("LibraryID")
|
b.Property<int?>("LibraryID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
@ -406,8 +361,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasIndex("LibraryID");
|
b.HasIndex("LibraryID");
|
||||||
|
|
||||||
b.HasIndex("ProviderID");
|
b.HasIndex("ProviderID");
|
||||||
@ -422,10 +375,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("ImgPrimary")
|
b.Property<string>("Overview")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Overview")
|
b.Property<string>("Poster")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("SeasonNumber")
|
b.Property<int>("SeasonNumber")
|
||||||
@ -448,7 +401,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("Seasons");
|
b.ToTable("Seasons");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Show", b =>
|
modelBuilder.Entity("Kyoo.Models.ShowDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@ -461,10 +414,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.Property<string>("Backdrop")
|
b.Property<string>("Backdrop")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int?>("EndYear")
|
b.Property<int?>("EndYear")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
@ -484,6 +433,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int?>("StartYear")
|
b.Property<int?>("StartYear")
|
||||||
@ -508,9 +458,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
b.HasIndex("StudioID");
|
b.HasIndex("StudioID");
|
||||||
|
|
||||||
b.ToTable("Show");
|
b.ToTable("Shows");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Show");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
||||||
@ -524,6 +474,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -575,50 +526,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("Tracks");
|
b.ToTable("Tracks");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Collection");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("CollectionDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Genre");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("GenreDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Library");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("LibraryDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.ShowDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Show");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("ShowDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.CollectionDE", null)
|
b.HasOne("Kyoo.Models.CollectionDE", "Collection")
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
.HasForeignKey("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Collection", "Collection")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ShowDE", null)
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("CollectionLinks")
|
.WithMany("CollectionLinks")
|
||||||
.HasForeignKey("ShowDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -630,7 +545,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.WithMany("Episodes")
|
.WithMany("Episodes")
|
||||||
.HasForeignKey("SeasonID");
|
.HasForeignKey("SeasonID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("Episodes")
|
.WithMany("Episodes")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -639,22 +554,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.GenreDE", null)
|
b.HasOne("Kyoo.Models.GenreDE", "Genre")
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
.HasForeignKey("GenreDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Genre", "Genre")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("GenreID")
|
.HasForeignKey("GenreID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ShowDE", null)
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("GenreLinks")
|
.WithMany("GenreLinks")
|
||||||
.HasForeignKey("ShowDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -662,30 +569,18 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.CollectionDE", null)
|
b.HasOne("Kyoo.Models.CollectionDE", "Collection")
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
.HasForeignKey("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Collection", "Collection")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.LibraryDE", null)
|
b.HasOne("Kyoo.Models.LibraryDE", "Library")
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
.HasForeignKey("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("LibraryID")
|
.HasForeignKey("LibraryID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ShowDE", null)
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
.HasForeignKey("ShowDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ShowID");
|
.HasForeignKey("ShowID");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -712,7 +607,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasForeignKey("SeasonID")
|
.HasForeignKey("SeasonID")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("ExternalIDs")
|
.WithMany("ExternalIDs")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
@ -726,7 +621,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("People")
|
.WithMany("People")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -735,12 +630,8 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.LibraryDE", null)
|
b.HasOne("Kyoo.Models.LibraryDE", "Library")
|
||||||
.WithMany("ProviderLinks")
|
.WithMany("ProviderLinks")
|
||||||
.HasForeignKey("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("LibraryID");
|
.HasForeignKey("LibraryID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ProviderID", "Provider")
|
b.HasOne("Kyoo.Models.ProviderID", "Provider")
|
||||||
@ -752,17 +643,17 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Season", b =>
|
modelBuilder.Entity("Kyoo.Models.Season", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("Seasons")
|
.WithMany("Seasons")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Show", b =>
|
modelBuilder.Entity("Kyoo.Models.ShowDE", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Studio", "Studio")
|
b.HasOne("Kyoo.Models.Studio", "Studio")
|
||||||
.WithMany("Shows")
|
.WithMany()
|
||||||
.HasForeignKey("StudioID");
|
.HasForeignKey("StudioID");
|
||||||
});
|
});
|
||||||
|
|
@ -14,51 +14,48 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.Annotation("Npgsql:Enum:stream_type", "unknow,video,audio,subtitle");
|
.Annotation("Npgsql:Enum:stream_type", "unknow,video,audio,subtitle");
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Collection",
|
name: "Collections",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: true),
|
Name = table.Column<string>(nullable: true),
|
||||||
Poster = table.Column<string>(nullable: true),
|
Poster = table.Column<string>(nullable: true),
|
||||||
Overview = table.Column<string>(nullable: true),
|
Overview = table.Column<string>(nullable: true)
|
||||||
Discriminator = table.Column<string>(nullable: false)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Collection", x => x.ID);
|
table.PrimaryKey("PK_Collections", x => x.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Genre",
|
name: "Genres",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: true),
|
Name = table.Column<string>(nullable: true)
|
||||||
Discriminator = table.Column<string>(nullable: false)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Genre", x => x.ID);
|
table.PrimaryKey("PK_Genres", x => x.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Library",
|
name: "Libraries",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: true),
|
Name = table.Column<string>(nullable: true),
|
||||||
Paths = table.Column<string[]>(type: "text[]", nullable: true),
|
Paths = table.Column<string[]>(type: "text[]", nullable: true)
|
||||||
Discriminator = table.Column<string>(nullable: false)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Library", x => x.ID);
|
table.PrimaryKey("PK_Libraries", x => x.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
@ -67,7 +64,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: true),
|
Name = table.Column<string>(nullable: true),
|
||||||
Poster = table.Column<string>(nullable: true)
|
Poster = table.Column<string>(nullable: true)
|
||||||
},
|
},
|
||||||
@ -82,7 +79,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: true),
|
Name = table.Column<string>(nullable: true),
|
||||||
Logo = table.Column<string>(nullable: true)
|
Logo = table.Column<string>(nullable: true)
|
||||||
},
|
},
|
||||||
@ -97,7 +94,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Name = table.Column<string>(nullable: true)
|
Name = table.Column<string>(nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
@ -112,22 +109,15 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
ProviderID = table.Column<int>(nullable: false),
|
ProviderID = table.Column<int>(nullable: false),
|
||||||
LibraryID = table.Column<int>(nullable: true),
|
LibraryID = table.Column<int>(nullable: true)
|
||||||
LibraryDEID = table.Column<int>(nullable: true)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_ProviderLinks", x => x.ID);
|
table.PrimaryKey("PK_ProviderLinks", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_ProviderLinks_Library_LibraryDEID",
|
name: "FK_ProviderLinks_Libraries_LibraryID",
|
||||||
column: x => x.LibraryDEID,
|
|
||||||
principalTable: "Library",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_ProviderLinks_Library_LibraryID",
|
|
||||||
column: x => x.LibraryID,
|
column: x => x.LibraryID,
|
||||||
principalTable: "Library",
|
principalTable: "Libraries",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
@ -139,12 +129,12 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Show",
|
name: "Shows",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: false),
|
||||||
Title = table.Column<string>(nullable: true),
|
Title = table.Column<string>(nullable: true),
|
||||||
Aliases = table.Column<string[]>(type: "text[]", nullable: true),
|
Aliases = table.Column<string[]>(type: "text[]", nullable: true),
|
||||||
Path = table.Column<string>(nullable: true),
|
Path = table.Column<string>(nullable: true),
|
||||||
@ -157,14 +147,13 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
Logo = table.Column<string>(nullable: true),
|
Logo = table.Column<string>(nullable: true),
|
||||||
Backdrop = table.Column<string>(nullable: true),
|
Backdrop = table.Column<string>(nullable: true),
|
||||||
IsMovie = table.Column<bool>(nullable: false),
|
IsMovie = table.Column<bool>(nullable: false),
|
||||||
StudioID = table.Column<int>(nullable: true),
|
StudioID = table.Column<int>(nullable: true)
|
||||||
Discriminator = table.Column<string>(nullable: false)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Show", x => x.ID);
|
table.PrimaryKey("PK_Shows", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Show_Studios_StudioID",
|
name: "FK_Shows_Studios_StudioID",
|
||||||
column: x => x.StudioID,
|
column: x => x.StudioID,
|
||||||
principalTable: "Studios",
|
principalTable: "Studios",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
@ -178,35 +167,21 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
CollectionID = table.Column<int>(nullable: true),
|
CollectionID = table.Column<int>(nullable: true),
|
||||||
ShowID = table.Column<int>(nullable: false),
|
ShowID = table.Column<int>(nullable: false)
|
||||||
CollectionDEID = table.Column<int>(nullable: true),
|
|
||||||
ShowDEID = table.Column<int>(nullable: true)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_CollectionLinks", x => x.ID);
|
table.PrimaryKey("PK_CollectionLinks", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_CollectionLinks_Collection_CollectionDEID",
|
name: "FK_CollectionLinks_Collections_CollectionID",
|
||||||
column: x => x.CollectionDEID,
|
|
||||||
principalTable: "Collection",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_CollectionLinks_Collection_CollectionID",
|
|
||||||
column: x => x.CollectionID,
|
column: x => x.CollectionID,
|
||||||
principalTable: "Collection",
|
principalTable: "Collections",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_CollectionLinks_Show_ShowDEID",
|
name: "FK_CollectionLinks_Shows_ShowID",
|
||||||
column: x => x.ShowDEID,
|
|
||||||
principalTable: "Show",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_CollectionLinks_Show_ShowID",
|
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -216,35 +191,21 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ShowID = table.Column<int>(nullable: false),
|
ShowID = table.Column<int>(nullable: false),
|
||||||
GenreID = table.Column<int>(nullable: false),
|
GenreID = table.Column<int>(nullable: false)
|
||||||
GenreDEID = table.Column<int>(nullable: true),
|
|
||||||
ShowDEID = table.Column<int>(nullable: true)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_GenreLinks", x => new { x.ShowID, x.GenreID });
|
table.PrimaryKey("PK_GenreLinks", x => new { x.ShowID, x.GenreID });
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_GenreLinks_Genre_GenreDEID",
|
name: "FK_GenreLinks_Genres_GenreID",
|
||||||
column: x => x.GenreDEID,
|
|
||||||
principalTable: "Genre",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_GenreLinks_Genre_GenreID",
|
|
||||||
column: x => x.GenreID,
|
column: x => x.GenreID,
|
||||||
principalTable: "Genre",
|
principalTable: "Genres",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_GenreLinks_Show_ShowDEID",
|
name: "FK_GenreLinks_Shows_ShowID",
|
||||||
column: x => x.ShowDEID,
|
|
||||||
principalTable: "Show",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_GenreLinks_Show_ShowID",
|
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -257,48 +218,27 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
LibraryID = table.Column<int>(nullable: false),
|
LibraryID = table.Column<int>(nullable: false),
|
||||||
ShowID = table.Column<int>(nullable: true),
|
ShowID = table.Column<int>(nullable: true),
|
||||||
CollectionID = table.Column<int>(nullable: true),
|
CollectionID = table.Column<int>(nullable: true)
|
||||||
CollectionDEID = table.Column<int>(nullable: true),
|
|
||||||
LibraryDEID = table.Column<int>(nullable: true),
|
|
||||||
ShowDEID = table.Column<int>(nullable: true)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_LibraryLinks", x => x.ID);
|
table.PrimaryKey("PK_LibraryLinks", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_LibraryLinks_Collection_CollectionDEID",
|
name: "FK_LibraryLinks_Collections_CollectionID",
|
||||||
column: x => x.CollectionDEID,
|
|
||||||
principalTable: "Collection",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_LibraryLinks_Collection_CollectionID",
|
|
||||||
column: x => x.CollectionID,
|
column: x => x.CollectionID,
|
||||||
principalTable: "Collection",
|
principalTable: "Collections",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_LibraryLinks_Library_LibraryDEID",
|
name: "FK_LibraryLinks_Libraries_LibraryID",
|
||||||
column: x => x.LibraryDEID,
|
|
||||||
principalTable: "Library",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_LibraryLinks_Library_LibraryID",
|
|
||||||
column: x => x.LibraryID,
|
column: x => x.LibraryID,
|
||||||
principalTable: "Library",
|
principalTable: "Libraries",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_LibraryLinks_Show_ShowDEID",
|
name: "FK_LibraryLinks_Shows_ShowID",
|
||||||
column: x => x.ShowDEID,
|
|
||||||
principalTable: "Show",
|
|
||||||
principalColumn: "ID",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_LibraryLinks_Show_ShowID",
|
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
@ -324,9 +264,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_PeopleRoles_Show_ShowID",
|
name: "FK_PeopleRoles_Shows_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -342,15 +282,15 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
Title = table.Column<string>(nullable: true),
|
Title = table.Column<string>(nullable: true),
|
||||||
Overview = table.Column<string>(nullable: true),
|
Overview = table.Column<string>(nullable: true),
|
||||||
Year = table.Column<int>(nullable: true),
|
Year = table.Column<int>(nullable: true),
|
||||||
ImgPrimary = table.Column<string>(nullable: true)
|
Poster = table.Column<string>(nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Seasons", x => x.ID);
|
table.PrimaryKey("PK_Seasons", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Seasons_Show_ShowID",
|
name: "FK_Seasons_Shows_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -383,9 +323,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Episodes_Show_ShowID",
|
name: "FK_Episodes_Shows_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -432,9 +372,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_MetadataIds_Show_ShowID",
|
name: "FK_MetadataIds_Shows_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Show",
|
principalTable: "Shows",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -466,22 +406,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Collection_Slug",
|
|
||||||
table: "Collection",
|
|
||||||
column: "Slug",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_CollectionLinks_CollectionDEID",
|
|
||||||
table: "CollectionLinks",
|
|
||||||
column: "CollectionDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_CollectionLinks_ShowDEID",
|
|
||||||
table: "CollectionLinks",
|
|
||||||
column: "ShowDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_CollectionLinks_ShowID",
|
name: "IX_CollectionLinks_ShowID",
|
||||||
table: "CollectionLinks",
|
table: "CollectionLinks",
|
||||||
@ -493,6 +417,12 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
columns: new[] { "CollectionID", "ShowID" },
|
columns: new[] { "CollectionID", "ShowID" },
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Collections_Slug",
|
||||||
|
table: "Collections",
|
||||||
|
column: "Slug",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Episodes_SeasonID",
|
name: "IX_Episodes_SeasonID",
|
||||||
table: "Episodes",
|
table: "Episodes",
|
||||||
@ -504,53 +434,28 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
columns: new[] { "ShowID", "SeasonNumber", "EpisodeNumber", "AbsoluteNumber" },
|
columns: new[] { "ShowID", "SeasonNumber", "EpisodeNumber", "AbsoluteNumber" },
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Genre_Slug",
|
|
||||||
table: "Genre",
|
|
||||||
column: "Slug",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_GenreLinks_GenreDEID",
|
|
||||||
table: "GenreLinks",
|
|
||||||
column: "GenreDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_GenreLinks_GenreID",
|
name: "IX_GenreLinks_GenreID",
|
||||||
table: "GenreLinks",
|
table: "GenreLinks",
|
||||||
column: "GenreID");
|
column: "GenreID");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_GenreLinks_ShowDEID",
|
name: "IX_Genres_Slug",
|
||||||
table: "GenreLinks",
|
table: "Genres",
|
||||||
column: "ShowDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Library_Slug",
|
|
||||||
table: "Library",
|
|
||||||
column: "Slug",
|
column: "Slug",
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_LibraryLinks_CollectionDEID",
|
name: "IX_Libraries_Slug",
|
||||||
table: "LibraryLinks",
|
table: "Libraries",
|
||||||
column: "CollectionDEID");
|
column: "Slug",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_LibraryLinks_CollectionID",
|
name: "IX_LibraryLinks_CollectionID",
|
||||||
table: "LibraryLinks",
|
table: "LibraryLinks",
|
||||||
column: "CollectionID");
|
column: "CollectionID");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_LibraryLinks_LibraryDEID",
|
|
||||||
table: "LibraryLinks",
|
|
||||||
column: "LibraryDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_LibraryLinks_ShowDEID",
|
|
||||||
table: "LibraryLinks",
|
|
||||||
column: "ShowDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_LibraryLinks_ShowID",
|
name: "IX_LibraryLinks_ShowID",
|
||||||
table: "LibraryLinks",
|
table: "LibraryLinks",
|
||||||
@ -609,11 +514,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
table: "PeopleRoles",
|
table: "PeopleRoles",
|
||||||
column: "ShowID");
|
column: "ShowID");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_ProviderLinks_LibraryDEID",
|
|
||||||
table: "ProviderLinks",
|
|
||||||
column: "LibraryDEID");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ProviderLinks_LibraryID",
|
name: "IX_ProviderLinks_LibraryID",
|
||||||
table: "ProviderLinks",
|
table: "ProviderLinks",
|
||||||
@ -637,14 +537,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Show_Slug",
|
name: "IX_Shows_Slug",
|
||||||
table: "Show",
|
table: "Shows",
|
||||||
column: "Slug",
|
column: "Slug",
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Show_StudioID",
|
name: "IX_Shows_StudioID",
|
||||||
table: "Show",
|
table: "Shows",
|
||||||
column: "StudioID");
|
column: "StudioID");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
@ -683,16 +583,16 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
name: "Tracks");
|
name: "Tracks");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Genre");
|
name: "Genres");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Collection");
|
name: "Collections");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "People");
|
name: "People");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Library");
|
name: "Libraries");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Providers");
|
name: "Providers");
|
||||||
@ -704,7 +604,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
name: "Seasons");
|
name: "Seasons");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Show");
|
name: "Shows");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Studios");
|
name: "Studios");
|
@ -23,17 +23,13 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasAnnotation("ProductVersion", "3.1.3")
|
.HasAnnotation("ProductVersion", "3.1.3")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Collection", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
@ -44,6 +40,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -51,9 +48,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Collection");
|
b.ToTable("Collections");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Collection");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
||||||
@ -63,24 +60,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int?>("CollectionDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("CollectionID")
|
b.Property<int?>("CollectionID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("ShowDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("ShowID")
|
b.Property<int>("ShowID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowID");
|
b.HasIndex("ShowID");
|
||||||
|
|
||||||
b.HasIndex("CollectionID", "ShowID")
|
b.HasIndex("CollectionID", "ShowID")
|
||||||
@ -139,21 +126,18 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("Episodes");
|
b.ToTable("Episodes");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Genre", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -161,9 +145,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Genre");
|
b.ToTable("Genres");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Genre");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
@ -174,34 +158,20 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.Property<int>("GenreID")
|
b.Property<int>("GenreID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("GenreDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("ShowDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("ShowID", "GenreID");
|
b.HasKey("ShowID", "GenreID");
|
||||||
|
|
||||||
b.HasIndex("GenreDEID");
|
|
||||||
|
|
||||||
b.HasIndex("GenreID");
|
b.HasIndex("GenreID");
|
||||||
|
|
||||||
b.HasIndex("ShowDEID");
|
|
||||||
|
|
||||||
b.ToTable("GenreLinks");
|
b.ToTable("GenreLinks");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Library", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
@ -209,6 +179,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text[]");
|
.HasColumnType("text[]");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -216,9 +187,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Library");
|
b.ToTable("Libraries");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Library");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
@ -228,34 +199,19 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int?>("CollectionDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("CollectionID")
|
b.Property<int?>("CollectionID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("LibraryDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("LibraryID")
|
b.Property<int>("LibraryID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<int?>("ShowDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("ShowID")
|
b.Property<int?>("ShowID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasIndex("CollectionID");
|
b.HasIndex("CollectionID");
|
||||||
|
|
||||||
b.HasIndex("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowDEID");
|
|
||||||
|
|
||||||
b.HasIndex("ShowID");
|
b.HasIndex("ShowID");
|
||||||
|
|
||||||
b.HasIndex("LibraryID", "CollectionID")
|
b.HasIndex("LibraryID", "CollectionID")
|
||||||
@ -324,6 +280,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -376,6 +333,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -393,9 +351,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<int?>("LibraryDEID")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("LibraryID")
|
b.Property<int?>("LibraryID")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
@ -404,8 +359,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
|
|
||||||
b.HasIndex("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasIndex("LibraryID");
|
b.HasIndex("LibraryID");
|
||||||
|
|
||||||
b.HasIndex("ProviderID");
|
b.HasIndex("ProviderID");
|
||||||
@ -420,10 +373,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("ImgPrimary")
|
b.Property<string>("Overview")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Overview")
|
b.Property<string>("Poster")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("SeasonNumber")
|
b.Property<int>("SeasonNumber")
|
||||||
@ -446,7 +399,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("Seasons");
|
b.ToTable("Seasons");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Show", b =>
|
modelBuilder.Entity("Kyoo.Models.ShowDE", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@ -459,10 +412,6 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.Property<string>("Backdrop")
|
b.Property<string>("Backdrop")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Discriminator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int?>("EndYear")
|
b.Property<int?>("EndYear")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
@ -482,6 +431,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int?>("StartYear")
|
b.Property<int?>("StartYear")
|
||||||
@ -506,9 +456,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
b.HasIndex("StudioID");
|
b.HasIndex("StudioID");
|
||||||
|
|
||||||
b.ToTable("Show");
|
b.ToTable("Shows");
|
||||||
|
|
||||||
b.HasDiscriminator<string>("Discriminator").HasValue("Show");
|
b.HasDiscriminator();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
||||||
@ -522,6 +472,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("ID");
|
b.HasKey("ID");
|
||||||
@ -573,50 +524,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("Tracks");
|
b.ToTable("Tracks");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Collection");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("CollectionDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Genre");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("GenreDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Library");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("LibraryDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.ShowDE", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("Kyoo.Models.Show");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("ShowDE");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.CollectionDE", null)
|
b.HasOne("Kyoo.Models.CollectionDE", "Collection")
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
.HasForeignKey("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Collection", "Collection")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ShowDE", null)
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("CollectionLinks")
|
.WithMany("CollectionLinks")
|
||||||
.HasForeignKey("ShowDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -628,7 +543,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.WithMany("Episodes")
|
.WithMany("Episodes")
|
||||||
.HasForeignKey("SeasonID");
|
.HasForeignKey("SeasonID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("Episodes")
|
.WithMany("Episodes")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -637,22 +552,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.GenreDE", null)
|
b.HasOne("Kyoo.Models.GenreDE", "Genre")
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
.HasForeignKey("GenreDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Genre", "Genre")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("GenreID")
|
.HasForeignKey("GenreID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ShowDE", null)
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("GenreLinks")
|
.WithMany("GenreLinks")
|
||||||
.HasForeignKey("ShowDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -660,30 +567,18 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.CollectionDE", null)
|
b.HasOne("Kyoo.Models.CollectionDE", "Collection")
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
.HasForeignKey("CollectionDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Collection", "Collection")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.LibraryDE", null)
|
b.HasOne("Kyoo.Models.LibraryDE", "Library")
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
.HasForeignKey("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("LibraryID")
|
.HasForeignKey("LibraryID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ShowDE", null)
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
.HasForeignKey("ShowDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ShowID");
|
.HasForeignKey("ShowID");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -710,7 +605,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.HasForeignKey("SeasonID")
|
.HasForeignKey("SeasonID")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("ExternalIDs")
|
.WithMany("ExternalIDs")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
@ -724,7 +619,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("People")
|
.WithMany("People")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -733,12 +628,8 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.LibraryDE", null)
|
b.HasOne("Kyoo.Models.LibraryDE", "Library")
|
||||||
.WithMany("ProviderLinks")
|
.WithMany("ProviderLinks")
|
||||||
.HasForeignKey("LibraryDEID");
|
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("LibraryID");
|
.HasForeignKey("LibraryID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.ProviderID", "Provider")
|
b.HasOne("Kyoo.Models.ProviderID", "Provider")
|
||||||
@ -750,17 +641,17 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Season", b =>
|
modelBuilder.Entity("Kyoo.Models.Season", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", "Show")
|
||||||
.WithMany("Seasons")
|
.WithMany("Seasons")
|
||||||
.HasForeignKey("ShowID")
|
.HasForeignKey("ShowID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Show", b =>
|
modelBuilder.Entity("Kyoo.Models.ShowDE", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Studio", "Studio")
|
b.HasOne("Kyoo.Models.Studio", "Studio")
|
||||||
.WithMany("Shows")
|
.WithMany()
|
||||||
.HasForeignKey("StudioID");
|
.HasForeignKey("StudioID");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Kyoo.Models.Attributes;
|
using Kyoo.Models.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Kyoo.Models
|
namespace Kyoo.Models
|
||||||
{
|
{
|
||||||
public class CollectionDE : Collection
|
public class CollectionDE : Collection
|
||||||
{
|
{
|
||||||
[NotMergable] public virtual IEnumerable<CollectionLink> Links { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<CollectionLink> Links { get; set; }
|
||||||
public override IEnumerable<Show> Shows
|
public override IEnumerable<Show> Shows
|
||||||
{
|
{
|
||||||
get => Links?.Select(x => x.Show);
|
get => Links?.Select(x => x.Show);
|
||||||
set => Links = value?.Select(x => new CollectionLink(this, x));
|
set => Links = value?.Select(x => new CollectionLink(this, x));
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMergable] public virtual IEnumerable<LibraryLink> LibraryLinks { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<LibraryLink> LibraryLinks { get; set; }
|
||||||
public override IEnumerable<Library> Libraries
|
public override IEnumerable<Library> Libraries
|
||||||
{
|
{
|
||||||
get => LibraryLinks?.Select(x => x.Library);
|
get => LibraryLinks?.Select(x => x.Library);
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Kyoo.Models.Attributes;
|
using Kyoo.Models.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Kyoo.Models
|
namespace Kyoo.Models
|
||||||
{
|
{
|
||||||
public class GenreDE : Genre
|
public class GenreDE : Genre
|
||||||
{
|
{
|
||||||
[NotMergable] public virtual IEnumerable<GenreLink> Links { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<GenreLink> Links { get; set; }
|
||||||
|
|
||||||
[NotMergable] public override IEnumerable<Show> Shows
|
[JsonIgnore] [NotMergable] public override IEnumerable<Show> Shows
|
||||||
{
|
{
|
||||||
get => Links?.Select(x => x.Show);
|
get => Links?.Select(x => x.Show);
|
||||||
set => Links = value?.Select(x => new GenreLink(x, this));
|
set => Links = value?.Select(x => new GenreLink(x, this));
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Kyoo.Models.Attributes;
|
using Kyoo.Models.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Kyoo.Models
|
namespace Kyoo.Models
|
||||||
{
|
{
|
||||||
public class LibraryDE : Library
|
public class LibraryDE : Library
|
||||||
{
|
{
|
||||||
[NotMergable] public virtual IEnumerable<ProviderLink> ProviderLinks { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<ProviderLink> ProviderLinks { get; set; }
|
||||||
public override IEnumerable<ProviderID> Providers
|
public override IEnumerable<ProviderID> Providers
|
||||||
{
|
{
|
||||||
get => ProviderLinks?.Select(x => x.Provider);
|
get => ProviderLinks?.Select(x => x.Provider);
|
||||||
set => ProviderLinks = value?.Select(x => new ProviderLink(x, this)).ToList();
|
set => ProviderLinks = value?.Select(x => new ProviderLink(x, this)).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMergable] public virtual IEnumerable<LibraryLink> Links { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<LibraryLink> Links { get; set; }
|
||||||
public override IEnumerable<Show> Shows
|
public override IEnumerable<Show> Shows
|
||||||
{
|
{
|
||||||
get => Links?.Where(x => x.Show != null).Select(x => x.Show);
|
get => Links?.Where(x => x.Show != null).Select(x => x.Show);
|
||||||
|
@ -1,26 +1,30 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Kyoo.Models.Attributes;
|
using Kyoo.Models.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO Remove every [JsonIgnore] tag from here once the serializer knows which property should be serialized.
|
||||||
|
|
||||||
namespace Kyoo.Models
|
namespace Kyoo.Models
|
||||||
{
|
{
|
||||||
public class ShowDE : Show
|
public class ShowDE : Show
|
||||||
{
|
{
|
||||||
[NotMergable] public virtual IEnumerable<GenreLink> GenreLinks { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<GenreLink> GenreLinks { get; set; }
|
||||||
public override IEnumerable<Genre> Genres
|
public override IEnumerable<Genre> Genres
|
||||||
{
|
{
|
||||||
get => GenreLinks?.Select(x => x.Genre);
|
get => GenreLinks?.Select(x => x.Genre);
|
||||||
set => GenreLinks = value?.Select(x => new GenreLink(this, x)).ToList();
|
set => GenreLinks = value?.Select(x => new GenreLink(this, x)).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMergable] public virtual IEnumerable<LibraryLink> LibraryLinks { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<LibraryLink> LibraryLinks { get; set; }
|
||||||
public override IEnumerable<Library> Libraries
|
public override IEnumerable<Library> Libraries
|
||||||
{
|
{
|
||||||
get => LibraryLinks?.Select(x => x.Library);
|
get => LibraryLinks?.Select(x => x.Library);
|
||||||
set => LibraryLinks = value?.Select(x => new LibraryLink(x, this));
|
set => LibraryLinks = value?.Select(x => new LibraryLink(x, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
[NotMergable] public virtual IEnumerable<CollectionLink> CollectionLinks { get; set; }
|
[JsonIgnore] [NotMergable] public virtual IEnumerable<CollectionLink> CollectionLinks { get; set; }
|
||||||
|
|
||||||
public override IEnumerable<Collection> Collections
|
public override IEnumerable<Collection> Collections
|
||||||
{
|
{
|
||||||
|
@ -46,9 +46,9 @@ namespace Kyoo
|
|||||||
services.AddDbContext<DatabaseContext>(options =>
|
services.AddDbContext<DatabaseContext>(options =>
|
||||||
{
|
{
|
||||||
options.UseLazyLoadingProxies()
|
options.UseLazyLoadingProxies()
|
||||||
.UseNpgsql(_configuration.GetConnectionString("Database"));
|
.UseNpgsql(_configuration.GetConnectionString("Database"))
|
||||||
// .EnableSensitiveDataLogging()
|
.EnableSensitiveDataLogging()
|
||||||
// .UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
|
.UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
|
||||||
}, ServiceLifetime.Transient);
|
}, ServiceLifetime.Transient);
|
||||||
|
|
||||||
services.AddDbContext<IdentityDatabase>(options =>
|
services.AddDbContext<IdentityDatabase>(options =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user