mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
PAL_SEHException. AGAIN. (Task's casting works now)
This commit is contained in:
parent
a258e89080
commit
ec47dbde53
@ -33,7 +33,8 @@ namespace Kyoo.Controllers
|
|||||||
Key = key;
|
Key = key;
|
||||||
Descendant = descendant;
|
Descendant = descendant;
|
||||||
|
|
||||||
if (Key.Body is MemberExpression ||
|
if (Key == null ||
|
||||||
|
Key.Body is MemberExpression ||
|
||||||
Key.Body.NodeType == ExpressionType.Convert && ((UnaryExpression)Key.Body).Operand is MemberExpression)
|
Key.Body.NodeType == ExpressionType.Convert && ((UnaryExpression)Key.Body).Operand is MemberExpression)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ namespace Kyoo
|
|||||||
throw new ArgumentNullException(nameof(methodName));
|
throw new ArgumentNullException(nameof(methodName));
|
||||||
if (type == null)
|
if (type == null)
|
||||||
throw new ArgumentNullException(nameof(type));
|
throw new ArgumentNullException(nameof(type));
|
||||||
MethodInfo method = owner.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
MethodInfo method = owner.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
|
||||||
if (method == null)
|
if (method == null)
|
||||||
throw new NullReferenceException($"A method named {methodName} could not be found on {owner.FullName}");
|
throw new NullReferenceException($"A method named {methodName} could not be found on {owner.FullName}");
|
||||||
return method.MakeGenericMethod(type).Invoke(null, args?.ToArray());
|
return method.MakeGenericMethod(type).Invoke(null, args?.ToArray());
|
||||||
@ -192,7 +192,7 @@ namespace Kyoo
|
|||||||
throw new ArgumentNullException(nameof(methodName));
|
throw new ArgumentNullException(nameof(methodName));
|
||||||
if (type == null)
|
if (type == null)
|
||||||
throw new ArgumentNullException(nameof(type));
|
throw new ArgumentNullException(nameof(type));
|
||||||
MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
|
MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
|
||||||
if (method == null)
|
if (method == null)
|
||||||
throw new NullReferenceException($"A method named {methodName} could not be found on {instance.GetType().FullName}");
|
throw new NullReferenceException($"A method named {methodName} could not be found on {instance.GetType().FullName}");
|
||||||
return method.MakeGenericMethod(type).Invoke(instance, args?.ToArray());
|
return method.MakeGenericMethod(type).Invoke(instance, args?.ToArray());
|
||||||
@ -250,15 +250,19 @@ namespace Kyoo
|
|||||||
|
|
||||||
public static Task<T> Cast<T>(this Task task)
|
public static Task<T> Cast<T>(this Task task)
|
||||||
{
|
{
|
||||||
return (Task<T>)task;
|
return task.ContinueWith(x => (T)((dynamic)x).Result,
|
||||||
|
TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Expression<T> Convert<T>(this Expression expr)
|
public static Expression<T> Convert<T>([CanBeNull] this Expression expr)
|
||||||
where T : Delegate
|
where T : Delegate
|
||||||
{
|
{
|
||||||
if (expr is LambdaExpression lambda)
|
return expr switch
|
||||||
return new ExpressionConverter<T>(lambda).VisitAndConvert();
|
{
|
||||||
throw new ArgumentException("Can't convert a non lambda.");
|
null => null,
|
||||||
|
LambdaExpression lambda => new ExpressionConverter<T>(lambda).VisitAndConvert(),
|
||||||
|
_ => throw new ArgumentException("Can't convert a non lambda.")
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ExpressionConverter<TTo> : ExpressionVisitor
|
private class ExpressionConverter<TTo> : ExpressionVisitor
|
||||||
|
@ -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("20200804172021_Initial")]
|
[Migration("20200815231223_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@ -32,6 +32,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.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");
|
||||||
|
|
||||||
@ -49,7 +53,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Collections");
|
b.ToTable("Collection");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Collection");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
||||||
@ -59,14 +65,24 @@ 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")
|
||||||
@ -88,15 +104,15 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.Property<int>("EpisodeNumber")
|
b.Property<int>("EpisodeNumber")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("ImgPrimary")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Overview")
|
b.Property<string>("Overview")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Path")
|
b.Property<string>("Path")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Poster")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<DateTime?>("ReleaseDate")
|
b.Property<DateTime?>("ReleaseDate")
|
||||||
.HasColumnType("timestamp without time zone");
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
@ -132,6 +148,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.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");
|
||||||
|
|
||||||
@ -143,7 +163,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Genres");
|
b.ToTable("Genre");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Genre");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
@ -154,10 +176,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");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -168,6 +200,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.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");
|
||||||
|
|
||||||
@ -182,7 +218,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Libraries");
|
b.ToTable("Library");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Library");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
@ -192,19 +230,34 @@ 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")
|
||||||
@ -283,7 +336,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("People");
|
b.ToTable("People");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.PeopleLink", b =>
|
modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@ -342,6 +395,9 @@ 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");
|
||||||
|
|
||||||
@ -350,6 +406,8 @@ 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");
|
||||||
@ -403,6 +461,10 @@ 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");
|
||||||
|
|
||||||
@ -446,7 +508,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
b.HasIndex("StudioID");
|
b.HasIndex("StudioID");
|
||||||
|
|
||||||
b.ToTable("Shows");
|
b.ToTable("Show");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Show");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
||||||
@ -511,14 +575,50 @@ 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.Collection", "Collection")
|
b.HasOne("Kyoo.Models.CollectionDE", null)
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
|
.HasForeignKey("CollectionDEID");
|
||||||
|
|
||||||
|
b.HasOne("Kyoo.Models.Collection", "Collection")
|
||||||
|
.WithMany()
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", null)
|
||||||
.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();
|
||||||
@ -539,14 +639,22 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Genre", "Genre")
|
b.HasOne("Kyoo.Models.GenreDE", null)
|
||||||
.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.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", null)
|
||||||
.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();
|
||||||
@ -554,18 +662,30 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Collection", "Collection")
|
b.HasOne("Kyoo.Models.CollectionDE", null)
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
|
.HasForeignKey("CollectionDEID");
|
||||||
|
|
||||||
|
b.HasOne("Kyoo.Models.Collection", "Collection")
|
||||||
|
.WithMany()
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
b.HasOne("Kyoo.Models.LibraryDE", null)
|
||||||
.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.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", null)
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
|
.HasForeignKey("ShowDEID");
|
||||||
|
|
||||||
|
b.HasOne("Kyoo.Models.Show", "Show")
|
||||||
|
.WithMany()
|
||||||
.HasForeignKey("ShowID");
|
.HasForeignKey("ShowID");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -598,7 +718,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.PeopleLink", b =>
|
modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.People", "People")
|
b.HasOne("Kyoo.Models.People", "People")
|
||||||
.WithMany("Roles")
|
.WithMany("Roles")
|
||||||
@ -615,8 +735,12 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
b.HasOne("Kyoo.Models.LibraryDE", null)
|
||||||
.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")
|
@ -14,7 +14,7 @@ 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: "Collections",
|
name: "Collection",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
@ -22,40 +22,43 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
Slug = table.Column<string>(nullable: true),
|
Slug = table.Column<string>(nullable: true),
|
||||||
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_Collections", x => x.ID);
|
table.PrimaryKey("PK_Collection", x => x.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Genres",
|
name: "Genre",
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
ID = table.Column<int>(nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Slug = table.Column<string>(nullable: true),
|
|
||||||
Name = table.Column<string>(nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Genres", x => x.ID);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
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: true),
|
||||||
Name = table.Column<string>(nullable: true),
|
Name = table.Column<string>(nullable: true),
|
||||||
Paths = table.Column<string[]>(type: "text[]", nullable: true)
|
Discriminator = table.Column<string>(nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Libraries", x => x.ID);
|
table.PrimaryKey("PK_Genre", x => x.ID);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Library",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
ID = table.Column<int>(nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
Slug = table.Column<string>(nullable: true),
|
||||||
|
Name = table.Column<string>(nullable: true),
|
||||||
|
Paths = table.Column<string[]>(type: "text[]", nullable: true),
|
||||||
|
Discriminator = table.Column<string>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Library", x => x.ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
@ -109,15 +112,22 @@ 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_Libraries_LibraryID",
|
name: "FK_ProviderLinks_Library_LibraryDEID",
|
||||||
|
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: "Libraries",
|
principalTable: "Library",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
@ -129,7 +139,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Shows",
|
name: "Show",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
ID = table.Column<int>(nullable: false)
|
ID = table.Column<int>(nullable: false)
|
||||||
@ -147,13 +157,14 @@ 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_Shows", x => x.ID);
|
table.PrimaryKey("PK_Show", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Shows_Studios_StudioID",
|
name: "FK_Show_Studios_StudioID",
|
||||||
column: x => x.StudioID,
|
column: x => x.StudioID,
|
||||||
principalTable: "Studios",
|
principalTable: "Studios",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
@ -167,21 +178,35 @@ 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_Collections_CollectionID",
|
name: "FK_CollectionLinks_Collection_CollectionDEID",
|
||||||
column: x => x.CollectionID,
|
column: x => x.CollectionDEID,
|
||||||
principalTable: "Collections",
|
principalTable: "Collection",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_CollectionLinks_Shows_ShowID",
|
name: "FK_CollectionLinks_Collection_CollectionID",
|
||||||
|
column: x => x.CollectionID,
|
||||||
|
principalTable: "Collection",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CollectionLinks_Show_ShowDEID",
|
||||||
|
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: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -191,21 +216,35 @@ 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_Genres_GenreID",
|
name: "FK_GenreLinks_Genre_GenreDEID",
|
||||||
|
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: "Genres",
|
principalTable: "Genre",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_GenreLinks_Shows_ShowID",
|
name: "FK_GenreLinks_Show_ShowDEID",
|
||||||
|
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: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -218,27 +257,48 @@ 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_Collections_CollectionID",
|
name: "FK_LibraryLinks_Collection_CollectionDEID",
|
||||||
column: x => x.CollectionID,
|
column: x => x.CollectionDEID,
|
||||||
principalTable: "Collections",
|
principalTable: "Collection",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_LibraryLinks_Libraries_LibraryID",
|
name: "FK_LibraryLinks_Collection_CollectionID",
|
||||||
|
column: x => x.CollectionID,
|
||||||
|
principalTable: "Collection",
|
||||||
|
principalColumn: "ID",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_LibraryLinks_Library_LibraryDEID",
|
||||||
|
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: "Libraries",
|
principalTable: "Library",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_LibraryLinks_Shows_ShowID",
|
name: "FK_LibraryLinks_Show_ShowDEID",
|
||||||
|
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: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
@ -264,9 +324,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_PeopleRoles_Shows_ShowID",
|
name: "FK_PeopleRoles_Show_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -288,9 +348,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Seasons", x => x.ID);
|
table.PrimaryKey("PK_Seasons", x => x.ID);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Seasons_Shows_ShowID",
|
name: "FK_Seasons_Show_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -311,7 +371,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
Overview = table.Column<string>(nullable: true),
|
Overview = table.Column<string>(nullable: true),
|
||||||
ReleaseDate = table.Column<DateTime>(nullable: true),
|
ReleaseDate = table.Column<DateTime>(nullable: true),
|
||||||
Runtime = table.Column<int>(nullable: false),
|
Runtime = table.Column<int>(nullable: false),
|
||||||
ImgPrimary = table.Column<string>(nullable: true)
|
Poster = table.Column<string>(nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -323,9 +383,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_Episodes_Shows_ShowID",
|
name: "FK_Episodes_Show_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -372,9 +432,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "FK_MetadataIds_Shows_ShowID",
|
name: "FK_MetadataIds_Show_ShowID",
|
||||||
column: x => x.ShowID,
|
column: x => x.ShowID,
|
||||||
principalTable: "Shows",
|
principalTable: "Show",
|
||||||
principalColumn: "ID",
|
principalColumn: "ID",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -406,6 +466,22 @@ 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",
|
||||||
@ -417,12 +493,6 @@ 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",
|
||||||
@ -434,28 +504,53 @@ 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_Genres_Slug",
|
name: "IX_GenreLinks_ShowDEID",
|
||||||
table: "Genres",
|
table: "GenreLinks",
|
||||||
|
column: "ShowDEID");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Library_Slug",
|
||||||
|
table: "Library",
|
||||||
column: "Slug",
|
column: "Slug",
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Libraries_Slug",
|
name: "IX_LibraryLinks_CollectionDEID",
|
||||||
table: "Libraries",
|
table: "LibraryLinks",
|
||||||
column: "Slug",
|
column: "CollectionDEID");
|
||||||
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",
|
||||||
@ -514,6 +609,11 @@ 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",
|
||||||
@ -537,14 +637,14 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Shows_Slug",
|
name: "IX_Show_Slug",
|
||||||
table: "Shows",
|
table: "Show",
|
||||||
column: "Slug",
|
column: "Slug",
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Shows_StudioID",
|
name: "IX_Show_StudioID",
|
||||||
table: "Shows",
|
table: "Show",
|
||||||
column: "StudioID");
|
column: "StudioID");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
@ -583,16 +683,16 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
name: "Tracks");
|
name: "Tracks");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Genres");
|
name: "Genre");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Collections");
|
name: "Collection");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "People");
|
name: "People");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Libraries");
|
name: "Library");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Providers");
|
name: "Providers");
|
||||||
@ -604,7 +704,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
name: "Seasons");
|
name: "Seasons");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Shows");
|
name: "Show");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Studios");
|
name: "Studios");
|
@ -30,6 +30,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.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");
|
||||||
|
|
||||||
@ -47,7 +51,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Collections");
|
b.ToTable("Collection");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Collection");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
modelBuilder.Entity("Kyoo.Models.CollectionLink", b =>
|
||||||
@ -57,14 +63,24 @@ 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")
|
||||||
@ -86,15 +102,15 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.Property<int>("EpisodeNumber")
|
b.Property<int>("EpisodeNumber")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("ImgPrimary")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Overview")
|
b.Property<string>("Overview")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("Path")
|
b.Property<string>("Path")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Poster")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<DateTime?>("ReleaseDate")
|
b.Property<DateTime?>("ReleaseDate")
|
||||||
.HasColumnType("timestamp without time zone");
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
@ -130,6 +146,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.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");
|
||||||
|
|
||||||
@ -141,7 +161,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Genres");
|
b.ToTable("Genre");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Genre");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
@ -152,10 +174,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");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -166,6 +198,10 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.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");
|
||||||
|
|
||||||
@ -180,7 +216,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.HasIndex("Slug")
|
b.HasIndex("Slug")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Libraries");
|
b.ToTable("Library");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Library");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
@ -190,19 +228,34 @@ 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")
|
||||||
@ -281,7 +334,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
b.ToTable("People");
|
b.ToTable("People");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.PeopleLink", b =>
|
modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ID")
|
b.Property<int>("ID")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@ -340,6 +393,9 @@ 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");
|
||||||
|
|
||||||
@ -348,6 +404,8 @@ 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");
|
||||||
@ -401,6 +459,10 @@ 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");
|
||||||
|
|
||||||
@ -444,7 +506,9 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
b.HasIndex("StudioID");
|
b.HasIndex("StudioID");
|
||||||
|
|
||||||
b.ToTable("Shows");
|
b.ToTable("Show");
|
||||||
|
|
||||||
|
b.HasDiscriminator<string>("Discriminator").HasValue("Show");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
modelBuilder.Entity("Kyoo.Models.Studio", b =>
|
||||||
@ -509,14 +573,50 @@ 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.Collection", "Collection")
|
b.HasOne("Kyoo.Models.CollectionDE", null)
|
||||||
.WithMany("Links")
|
.WithMany("Links")
|
||||||
|
.HasForeignKey("CollectionDEID");
|
||||||
|
|
||||||
|
b.HasOne("Kyoo.Models.Collection", "Collection")
|
||||||
|
.WithMany()
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", null)
|
||||||
.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();
|
||||||
@ -537,14 +637,22 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
modelBuilder.Entity("Kyoo.Models.GenreLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Genre", "Genre")
|
b.HasOne("Kyoo.Models.GenreDE", null)
|
||||||
.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.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", null)
|
||||||
.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();
|
||||||
@ -552,18 +660,30 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
modelBuilder.Entity("Kyoo.Models.LibraryLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Collection", "Collection")
|
b.HasOne("Kyoo.Models.CollectionDE", null)
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
|
.HasForeignKey("CollectionDEID");
|
||||||
|
|
||||||
|
b.HasOne("Kyoo.Models.Collection", "Collection")
|
||||||
|
.WithMany()
|
||||||
.HasForeignKey("CollectionID");
|
.HasForeignKey("CollectionID");
|
||||||
|
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
b.HasOne("Kyoo.Models.LibraryDE", null)
|
||||||
.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.Show", "Show")
|
b.HasOne("Kyoo.Models.ShowDE", null)
|
||||||
.WithMany("LibraryLinks")
|
.WithMany("LibraryLinks")
|
||||||
|
.HasForeignKey("ShowDEID");
|
||||||
|
|
||||||
|
b.HasOne("Kyoo.Models.Show", "Show")
|
||||||
|
.WithMany()
|
||||||
.HasForeignKey("ShowID");
|
.HasForeignKey("ShowID");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -596,7 +716,7 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.PeopleLink", b =>
|
modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.People", "People")
|
b.HasOne("Kyoo.Models.People", "People")
|
||||||
.WithMany("Roles")
|
.WithMany("Roles")
|
||||||
@ -613,8 +733,12 @@ namespace Kyoo.Models.DatabaseMigrations.Internal
|
|||||||
|
|
||||||
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
modelBuilder.Entity("Kyoo.Models.ProviderLink", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Models.Library", "Library")
|
b.HasOne("Kyoo.Models.LibraryDE", null)
|
||||||
.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")
|
||||||
|
@ -10,7 +10,7 @@ namespace Kyoo.Models
|
|||||||
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; }
|
[NotMergable] public virtual IEnumerable<LibraryLink> LibraryLinks { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user