diff --git a/Kyoo.Common/Controllers/Implementations/LibraryManager.cs b/Kyoo.Common/Controllers/Implementations/LibraryManager.cs
index 18159706..fee5a457 100644
--- a/Kyoo.Common/Controllers/Implementations/LibraryManager.cs
+++ b/Kyoo.Common/Controllers/Implementations/LibraryManager.cs
@@ -349,6 +349,10 @@ namespace Kyoo.Controllers
(People p, nameof(People.Roles)) => PeopleRepository
.GetFromPeople(obj.ID)
.Then(x => p.Roles = x),
+
+ (ProviderID p, nameof(ProviderID.Libraries)) => LibraryRepository
+ .GetAll(x => x.Providers.Any(y => y.ID == obj.ID))
+ .Then(x => p.Libraries = x),
_ => throw new ArgumentException($"Couldn't find a way to load {member} of {obj.Slug}.")
};
diff --git a/Kyoo.Common/Kyoo.Common.csproj b/Kyoo.Common/Kyoo.Common.csproj
index ff7ef1e2..59d84b4b 100644
--- a/Kyoo.Common/Kyoo.Common.csproj
+++ b/Kyoo.Common/Kyoo.Common.csproj
@@ -16,6 +16,8 @@
true
snupkg
default
+
+ ENABLE_INTERNAL_LINKS
diff --git a/Kyoo.Common/Models/Link.cs b/Kyoo.Common/Models/Link.cs
new file mode 100644
index 00000000..8dee75bb
--- /dev/null
+++ b/Kyoo.Common/Models/Link.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Linq.Expressions;
+
+namespace Kyoo.Models
+{
+ public class Link
+ where T1 : class, IResource
+ where T2 : class, IResource
+ {
+ public static Expression, object>> PrimaryKey
+ {
+ get
+ {
+ return x => new {LibraryID = x.FirstID, ProviderID = x.SecondID};
+ }
+ }
+
+ public int FirstID { get; set; }
+ public virtual T1 First { get; set; }
+ public int SecondID { get; set; }
+ public virtual T2 Second { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Kyoo.Common/Models/Resources/Collection.cs b/Kyoo.Common/Models/Resources/Collection.cs
index 34a41f7a..936620c9 100644
--- a/Kyoo.Common/Models/Resources/Collection.cs
+++ b/Kyoo.Common/Models/Resources/Collection.cs
@@ -13,6 +13,11 @@ namespace Kyoo.Models
[LoadableRelation] public virtual ICollection Shows { get; set; }
[LoadableRelation] public virtual ICollection Libraries { get; set; }
+#if ENABLE_INTERNAL_LINKS
+ [SerializeIgnore] public virtual ICollection> ShowLinks { get; set; }
+ [SerializeIgnore] public virtual ICollection> LibraryLinks { get; set; }
+#endif
+
public Collection() { }
public Collection(string slug, string name, string overview, string poster)
diff --git a/Kyoo.Common/Models/Resources/Genre.cs b/Kyoo.Common/Models/Resources/Genre.cs
index 26fbe5a4..cd6086df 100644
--- a/Kyoo.Common/Models/Resources/Genre.cs
+++ b/Kyoo.Common/Models/Resources/Genre.cs
@@ -10,7 +10,12 @@ namespace Kyoo.Models
public string Name { get; set; }
[LoadableRelation] public virtual ICollection Shows { get; set; }
-
+
+#if ENABLE_INTERNAL_LINKS
+ [SerializeIgnore] public virtual ICollection> ShowLinks { get; set; }
+#endif
+
+
public Genre() {}
public Genre(string name)
diff --git a/Kyoo.Common/Models/Resources/IResource.cs b/Kyoo.Common/Models/Resources/IResource.cs
index 83806ff5..297f3b1d 100644
--- a/Kyoo.Common/Models/Resources/IResource.cs
+++ b/Kyoo.Common/Models/Resources/IResource.cs
@@ -9,16 +9,6 @@ namespace Kyoo.Models
public string Slug { get; }
}
- public interface IResourceLink
- where T : IResource
- where T2 : IResource
- {
- public T Parent { get; }
- public int ParentID { get; }
- public T2 Child { get; }
- public int ChildID { get; }
- }
-
public class ResourceComparer : IEqualityComparer where T : IResource
{
public bool Equals(T x, T y)
@@ -37,27 +27,4 @@ namespace Kyoo.Models
return HashCode.Combine(obj.ID, obj.Slug);
}
}
-
- public class LinkComparer : IEqualityComparer
- where T : IResourceLink
- where T1 : IResource
- where T2 : IResource
- {
- public bool Equals(T x, T y)
- {
- if (ReferenceEquals(x, y))
- return true;
- if (ReferenceEquals(x, null))
- return false;
- if (ReferenceEquals(y, null))
- return false;
- return Utility.LinkEquals(x.Parent, x.ParentID, y.Parent, y.ParentID)
- && Utility.LinkEquals(x.Child, x.ChildID, y.Child, y.ChildID);
- }
-
- public int GetHashCode(T obj)
- {
- return HashCode.Combine(obj.Parent, obj.ParentID, obj.Child, obj.ChildID);
- }
- }
}
\ No newline at end of file
diff --git a/Kyoo.Common/Models/Resources/Library.cs b/Kyoo.Common/Models/Resources/Library.cs
index 54f9ac89..c1e17b56 100644
--- a/Kyoo.Common/Models/Resources/Library.cs
+++ b/Kyoo.Common/Models/Resources/Library.cs
@@ -16,6 +16,12 @@ namespace Kyoo.Models
[LoadableRelation] public virtual ICollection Shows { get; set; }
[LoadableRelation] public virtual ICollection Collections { get; set; }
+#if ENABLE_INTERNAL_LINKS
+ [SerializeIgnore] public virtual ICollection> ProviderLinks { get; set; }
+ [SerializeIgnore] public virtual ICollection> ShowLinks { get; set; }
+ [SerializeIgnore] public virtual ICollection> CollectionLinks { get; set; }
+#endif
+
public Library() { }
public Library(string slug, string name, IEnumerable paths, IEnumerable providers)
diff --git a/Kyoo.Common/Models/Resources/ProviderID.cs b/Kyoo.Common/Models/Resources/ProviderID.cs
index bb37b395..a874d09e 100644
--- a/Kyoo.Common/Models/Resources/ProviderID.cs
+++ b/Kyoo.Common/Models/Resources/ProviderID.cs
@@ -10,8 +10,12 @@ namespace Kyoo.Models
public string Name { get; set; }
public string Logo { get; set; }
- [LoadableRelation] public ICollection Libraries { get; set; }
-
+ [LoadableRelation] public virtual ICollection Libraries { get; set; }
+
+#if ENABLE_INTERNAL_LINKS
+ [SerializeIgnore] public virtual ICollection> LibraryLinks { get; set; }
+#endif
+
public ProviderID() { }
public ProviderID(string name, string logo)
diff --git a/Kyoo.Common/Models/Resources/Show.cs b/Kyoo.Common/Models/Resources/Show.cs
index c4feb24c..5eb50eed 100644
--- a/Kyoo.Common/Models/Resources/Show.cs
+++ b/Kyoo.Common/Models/Resources/Show.cs
@@ -35,6 +35,13 @@ namespace Kyoo.Models
[LoadableRelation] public virtual ICollection Episodes { get; set; }
[LoadableRelation] public virtual ICollection Libraries { get; set; }
[LoadableRelation] public virtual ICollection Collections { get; set; }
+
+#if ENABLE_INTERNAL_LINKS
+ [SerializeIgnore] public virtual ICollection> LibraryLinks { get; set; }
+ [SerializeIgnore] public virtual ICollection> CollectionLinks { get; set; }
+ [SerializeIgnore] public virtual ICollection> GenreLinks { get; set; }
+#endif
+
public Show() { }
diff --git a/Kyoo.Common/Utility.cs b/Kyoo.Common/Utility.cs
index 423edf1f..688e4d54 100644
--- a/Kyoo.Common/Utility.cs
+++ b/Kyoo.Common/Utility.cs
@@ -239,16 +239,25 @@ namespace Kyoo
return types.FirstOrDefault(x => x.IsGenericType && x.GetGenericTypeDefinition() == genericType);
}
- public static async IAsyncEnumerable SelectAsync(this IEnumerable self, Func> mapper)
+ public static async IAsyncEnumerable SelectAsync([NotNull] this IEnumerable self,
+ [NotNull] Func> mapper)
{
+ if (self == null)
+ throw new ArgumentNullException(nameof(self));
+ if (mapper == null)
+ throw new ArgumentNullException(nameof(mapper));
+
using IEnumerator enumerator = self.GetEnumerator();
while (enumerator.MoveNext())
yield return await mapper(enumerator.Current);
}
- public static async Task> ToListAsync(this IAsyncEnumerable self)
+ public static async Task> ToListAsync([NotNull] this IAsyncEnumerable self)
{
+ if (self == null)
+ throw new ArgumentNullException(nameof(self));
+
List ret = new();
await foreach(T i in self)
@@ -482,11 +491,14 @@ namespace Kyoo
Type type = GetEnumerableType(eno);
if (typeof(IResource).IsAssignableFrom(type))
return ResourceEquals(eno.Cast(), ens.Cast());
- Type genericDefinition = GetGenericDefinition(type, typeof(IResourceLink<,>));
- if (genericDefinition == null)
- return RunGenericMethod(typeof(Enumerable), "SequenceEqual", type, first, second);
- Type[] types = genericDefinition.GetGenericArguments().Prepend(type).ToArray();
- return RunGenericMethod(typeof(Utility), "LinkEquals", types, eno, ens);
+ return RunGenericMethod(typeof(Enumerable), "SequenceEqual", type, first, second);
+ }
+
+ public static void Test()
+ {
+ #if INTERNAL_LINKS
+ Console.WriteLine("Lib test");
+#endif
}
public static bool ResourceEquals([CanBeNull] T first, [CanBeNull] T second)
@@ -522,20 +534,7 @@ namespace Kyoo
return true;
return firstID == secondID;
}
-
- public static bool LinkEquals([CanBeNull] IEnumerable first, [CanBeNull] IEnumerable second)
- where T : IResourceLink
- where T1 : IResource
- where T2 : IResource
- {
- if (ReferenceEquals(first, second))
- return true;
- if (first == null || second == null)
- return false;
- return first.SequenceEqual(second, new LinkComparer());
- }
-
-
+
public static Expression Convert([CanBeNull] this Expression expr)
where T : Delegate
{
diff --git a/Kyoo/Controllers/ProviderManager.cs b/Kyoo/Controllers/ProviderManager.cs
index 1efea8e5..b2795c85 100644
--- a/Kyoo/Controllers/ProviderManager.cs
+++ b/Kyoo/Controllers/ProviderManager.cs
@@ -18,7 +18,7 @@ namespace Kyoo.Controllers
private async Task GetMetadata(Func> providerCall, Library library, string what)
where T : new()
{
- T ret = new T();
+ T ret = new();
IEnumerable providers = library?.Providers
.Select(x => _providers.FirstOrDefault(y => y.Provider.Slug == x.Slug))
diff --git a/Kyoo/Controllers/Repositories/LibraryRepository.cs b/Kyoo/Controllers/Repositories/LibraryRepository.cs
index f49691a9..f91231ad 100644
--- a/Kyoo/Controllers/Repositories/LibraryRepository.cs
+++ b/Kyoo/Controllers/Repositories/LibraryRepository.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Kyoo.Models;
using Kyoo.Models.Exceptions;
using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.Extensions.DependencyInjection;
namespace Kyoo.Controllers
@@ -54,7 +55,10 @@ namespace Kyoo.Controllers
public override async Task Create(Library obj)
{
await base.Create(obj);
- _database.Entry(obj).State = EntityState.Added;
+ // _database.Entry(obj).State = EntityState.Added;
+ // _database.Entry(obj).Collection(x => x.Providers).IsModified = true;
+ // _database.Add(obj);
+ // var a = EF.Property>>(obj, nameof(LibraryDE.LibraryLinks));
await _database.SaveChangesAsync($"Trying to insert a duplicated library (slug {obj.Slug} already exists).");
return obj;
}
@@ -70,9 +74,12 @@ namespace Kyoo.Controllers
await base.Validate(resource);
- resource.Providers = await resource.Providers
- .SelectAsync(x => _providers.CreateIfNotExists(x, true))
- .ToListAsync();
+ if (resource.Providers != null)
+ {
+ resource.Providers = await resource.Providers
+ .SelectAsync(x => _providers.CreateIfNotExists(x, true))
+ .ToListAsync();
+ }
}
public override async Task Delete(Library obj)
diff --git a/Kyoo/Controllers/Repositories/ShowRepository.cs b/Kyoo/Controllers/Repositories/ShowRepository.cs
index 8e41dd59..14a9e904 100644
--- a/Kyoo/Controllers/Repositories/ShowRepository.cs
+++ b/Kyoo/Controllers/Repositories/ShowRepository.cs
@@ -104,10 +104,13 @@ namespace Kyoo.Controllers
if (ShouldValidate(resource.Studio))
resource.Studio = await _studios.CreateIfNotExists(resource.Studio, true);
-
- resource.Genres = await resource.Genres
- .SelectAsync(x => _genres.CreateIfNotExists(x, true))
- .ToListAsync();
+
+ if (resource.Genres != null)
+ {
+ resource.Genres = await resource.Genres
+ .SelectAsync(x => _genres.CreateIfNotExists(x, true))
+ .ToListAsync();
+ }
if (resource.People != null)
foreach (PeopleRole link in resource.People)
@@ -125,25 +128,29 @@ namespace Kyoo.Controllers
Show show = await Get(showID);
if (collectionID != null)
{
+ Collection collection = _database.GetTemporaryObject(new Collection {ID = collectionID.Value});
+
show.Collections ??= new List();
- show.Collections.Add(new Collection {ID = collectionID.Value});
- await _database.SaveChangesAsync();
+ show.Collections.Add(collection);
+ await _database.SaveIfNoDuplicates();
+
+ if (libraryID != null)
+ {
+ Library library = await _database.Libraries.FirstOrDefaultAsync(x => x.ID == libraryID.Value);
+ if (library == null)
+ throw new ItemNotFound($"No library found with the ID {libraryID.Value}");
+ library.Collections ??= new List();
+ library.Collections.Add(collection);
+ await _database.SaveIfNoDuplicates();
+ }
}
if (libraryID != null)
{
+ Library library = _database.GetTemporaryObject(new Library {ID = libraryID.Value});
+
show.Libraries ??= new List();
- show.Libraries.Add(new Library {ID = libraryID.Value});
- await _database.SaveChangesAsync();
- }
-
- if (libraryID != null && collectionID != null)
- {
- Library library = await _database.Libraries.FirstOrDefaultAsync(x => x.ID == libraryID.Value);
- if (library == null)
- throw new ItemNotFound($"No library found with the ID {libraryID.Value}");
- library.Collections ??= new List();
- library.Collections.Add(new Collection {ID = collectionID.Value});
- await _database.SaveChangesAsync();
+ show.Libraries.Add(library);
+ await _database.SaveIfNoDuplicates();
}
}
diff --git a/Kyoo/Models/DatabaseContext.cs b/Kyoo/Models/DatabaseContext.cs
index bfb049df..423bd3e7 100644
--- a/Kyoo/Models/DatabaseContext.cs
+++ b/Kyoo/Models/DatabaseContext.cs
@@ -10,8 +10,6 @@ using Npgsql;
namespace Kyoo
{
- //TODO disable lazy loading a provide a LoadAsync method in the library manager.
-
public class DatabaseContext : DbContext
{
public DatabaseContext(DbContextOptions options) : base(options) { }
@@ -28,6 +26,7 @@ namespace Kyoo
public DbSet Providers { get; set; }
public DbSet MetadataIds { get; set; }
+ // TODO Many to many with UsingEntity for this.
public DbSet PeopleRoles { get; set; }
@@ -46,11 +45,6 @@ namespace Kyoo
modelBuilder.HasPostgresEnum();
modelBuilder.HasPostgresEnum();
- modelBuilder.Ignore();
- modelBuilder.Ignore();
- modelBuilder.Ignore();
- modelBuilder.Ignore();
-
modelBuilder.Entity()
.Property(x => x.Paths)
.HasColumnType("text[]");
@@ -67,6 +61,67 @@ namespace Kyoo
.Property(t => t.IsForced)
.ValueGeneratedNever();
+ modelBuilder.Entity()
+ .HasMany(x => x.Libraries)
+ .WithMany(x => x.Providers)
+ .UsingEntity>(
+ y => y
+ .HasOne(x => x.First)
+ .WithMany(x => x.ProviderLinks),
+ y => y
+ .HasOne(x => x.Second)
+ .WithMany(x => x.LibraryLinks),
+ y => y.HasKey(x => Link.PrimaryKey));
+
+ modelBuilder.Entity()
+ .HasMany(x => x.Libraries)
+ .WithMany(x => x.Collections)
+ .UsingEntity>(
+ y => y
+ .HasOne(x => x.First)
+ .WithMany(x => x.CollectionLinks),
+ y => y
+ .HasOne(x => x.Second)
+ .WithMany(x => x.LibraryLinks),
+ y => y.HasKey(x => Link.PrimaryKey));
+
+ modelBuilder.Entity()
+ .HasMany(x => x.Libraries)
+ .WithMany(x => x.Shows)
+ .UsingEntity>(
+ y => y
+ .HasOne(x => x.First)
+ .WithMany(x => x.ShowLinks),
+ y => y
+ .HasOne(x => x.Second)
+ .WithMany(x => x.LibraryLinks),
+ y => y.HasKey(x => Link.PrimaryKey));
+
+ modelBuilder.Entity()
+ .HasMany(x => x.Collections)
+ .WithMany(x => x.Shows)
+ .UsingEntity>(
+ y => y
+ .HasOne(x => x.First)
+ .WithMany(x => x.ShowLinks),
+ y => y
+ .HasOne(x => x.Second)
+ .WithMany(x => x.CollectionLinks),
+ y => y.HasKey(x => Link.PrimaryKey));
+
+ modelBuilder.Entity()
+ .HasMany(x => x.Shows)
+ .WithMany(x => x.Genres)
+ .UsingEntity>(
+ y => y
+ .HasOne(x => x.First)
+ .WithMany(x => x.GenreLinks),
+ y => y
+ .HasOne(x => x.Second)
+ .WithMany(x => x.ShowLinks),
+ y => y.HasKey(x => Link.PrimaryKey));
+
+
modelBuilder.Entity()
.HasOne(x => x.Show)
.WithMany(x => x.ExternalIDs)
@@ -121,6 +176,16 @@ namespace Kyoo
.IsUnique();
}
+ public T GetTemporaryObject(T model)
+ where T : class, IResource
+ {
+ T tmp = Set().Local.FirstOrDefault(x => x.ID == model.ID);
+ if (tmp != null)
+ return tmp;
+ Entry(model).State = EntityState.Unchanged;
+ return model;
+ }
+
public override int SaveChanges()
{
try
diff --git a/Kyoo/Models/DatabaseMigrations/IdentityConfiguration/20210216205007_Initial.Designer.cs b/Kyoo/Models/DatabaseMigrations/IdentityConfiguration/20210216205007_Initial.Designer.cs
deleted file mode 100644
index 87d6032d..00000000
--- a/Kyoo/Models/DatabaseMigrations/IdentityConfiguration/20210216205007_Initial.Designer.cs
+++ /dev/null
@@ -1,985 +0,0 @@
-//
-using System;
-using IdentityServer4.EntityFramework.DbContexts;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-namespace Kyoo.Models.DatabaseMigrations.IdentityConfiguration
-{
- [DbContext(typeof(ConfigurationDbContext))]
- [Migration("20210216205007_Initial")]
- partial class Initial
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("Relational:MaxIdentifierLength", 63)
- .HasAnnotation("ProductVersion", "5.0.3")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("AllowedAccessTokenSigningAlgorithms")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("Created")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DisplayName")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Enabled")
- .HasColumnType("boolean");
-
- b.Property("LastAccessed")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("NonEditable")
- .HasColumnType("boolean");
-
- b.Property("ShowInDiscoveryDocument")
- .HasColumnType("boolean");
-
- b.Property("Updated")
- .HasColumnType("timestamp without time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("ApiResources");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ApiResourceId")
- .HasColumnType("integer");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("ApiResourceId");
-
- b.ToTable("ApiResourceClaims");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ApiResourceId")
- .HasColumnType("integer");
-
- b.Property("Key")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ApiResourceId");
-
- b.ToTable("ApiResourceProperties");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ApiResourceId")
- .HasColumnType("integer");
-
- b.Property("Scope")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("ApiResourceId");
-
- b.ToTable("ApiResourceScopes");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ApiResourceId")
- .HasColumnType("integer");
-
- b.Property("Created")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("Expiration")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ApiResourceId");
-
- b.ToTable("ApiResourceSecrets");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DisplayName")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Emphasize")
- .HasColumnType("boolean");
-
- b.Property("Enabled")
- .HasColumnType("boolean");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Required")
- .HasColumnType("boolean");
-
- b.Property("ShowInDiscoveryDocument")
- .HasColumnType("boolean");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("ApiScopes");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ScopeId")
- .HasColumnType("integer");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("ScopeId");
-
- b.ToTable("ApiScopeClaims");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("Key")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("ScopeId")
- .HasColumnType("integer");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ScopeId");
-
- b.ToTable("ApiScopeProperties");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("AbsoluteRefreshTokenLifetime")
- .HasColumnType("integer");
-
- b.Property("AccessTokenLifetime")
- .HasColumnType("integer");
-
- b.Property("AccessTokenType")
- .HasColumnType("integer");
-
- b.Property("AllowAccessTokensViaBrowser")
- .HasColumnType("boolean");
-
- b.Property("AllowOfflineAccess")
- .HasColumnType("boolean");
-
- b.Property("AllowPlainTextPkce")
- .HasColumnType("boolean");
-
- b.Property("AllowRememberConsent")
- .HasColumnType("boolean");
-
- b.Property("AllowedIdentityTokenSigningAlgorithms")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("AlwaysIncludeUserClaimsInIdToken")
- .HasColumnType("boolean");
-
- b.Property("AlwaysSendClientClaims")
- .HasColumnType("boolean");
-
- b.Property("AuthorizationCodeLifetime")
- .HasColumnType("integer");
-
- b.Property("BackChannelLogoutSessionRequired")
- .HasColumnType("boolean");
-
- b.Property("BackChannelLogoutUri")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("ClientClaimsPrefix")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("ClientId")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("ClientName")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("ClientUri")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("ConsentLifetime")
- .HasColumnType("integer");
-
- b.Property("Created")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DeviceCodeLifetime")
- .HasColumnType("integer");
-
- b.Property("EnableLocalLogin")
- .HasColumnType("boolean");
-
- b.Property("Enabled")
- .HasColumnType("boolean");
-
- b.Property("FrontChannelLogoutSessionRequired")
- .HasColumnType("boolean");
-
- b.Property("FrontChannelLogoutUri")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("IdentityTokenLifetime")
- .HasColumnType("integer");
-
- b.Property("IncludeJwtId")
- .HasColumnType("boolean");
-
- b.Property("LastAccessed")
- .HasColumnType("timestamp without time zone");
-
- b.Property("LogoUri")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("NonEditable")
- .HasColumnType("boolean");
-
- b.Property("PairWiseSubjectSalt")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("ProtocolType")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("RefreshTokenExpiration")
- .HasColumnType("integer");
-
- b.Property("RefreshTokenUsage")
- .HasColumnType("integer");
-
- b.Property("RequireClientSecret")
- .HasColumnType("boolean");
-
- b.Property("RequireConsent")
- .HasColumnType("boolean");
-
- b.Property("RequirePkce")
- .HasColumnType("boolean");
-
- b.Property("RequireRequestObject")
- .HasColumnType("boolean");
-
- b.Property("SlidingRefreshTokenLifetime")
- .HasColumnType("integer");
-
- b.Property("UpdateAccessTokenClaimsOnRefresh")
- .HasColumnType("boolean");
-
- b.Property("Updated")
- .HasColumnType("timestamp without time zone");
-
- b.Property("UserCodeType")
- .HasMaxLength(100)
- .HasColumnType("character varying(100)");
-
- b.Property("UserSsoLifetime")
- .HasColumnType("integer");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId")
- .IsUnique();
-
- b.ToTable("Clients");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientClaims");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("Origin")
- .IsRequired()
- .HasMaxLength(150)
- .HasColumnType("character varying(150)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientCorsOrigins");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("GrantType")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientGrantTypes");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("Provider")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientIdPRestrictions");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("PostLogoutRedirectUri")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientPostLogoutRedirectUris");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("Key")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientProperties");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("RedirectUri")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientRedirectUris");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("Scope")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientScopes");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("ClientId")
- .HasColumnType("integer");
-
- b.Property("Created")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Description")
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.Property("Expiration")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(4000)
- .HasColumnType("character varying(4000)");
-
- b.HasKey("Id");
-
- b.HasIndex("ClientId");
-
- b.ToTable("ClientSecrets");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("Created")
- .HasColumnType("timestamp without time zone");
-
- b.Property("Description")
- .HasMaxLength(1000)
- .HasColumnType("character varying(1000)");
-
- b.Property("DisplayName")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Emphasize")
- .HasColumnType("boolean");
-
- b.Property("Enabled")
- .HasColumnType("boolean");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("NonEditable")
- .HasColumnType("boolean");
-
- b.Property("Required")
- .HasColumnType("boolean");
-
- b.Property("ShowInDiscoveryDocument")
- .HasColumnType("boolean");
-
- b.Property("Updated")
- .HasColumnType("timestamp without time zone");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique();
-
- b.ToTable("IdentityResources");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("IdentityResourceId")
- .HasColumnType("integer");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityResourceId");
-
- b.ToTable("IdentityResourceClaims");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
-
- b.Property("IdentityResourceId")
- .HasColumnType("integer");
-
- b.Property("Key")
- .IsRequired()
- .HasMaxLength(250)
- .HasColumnType("character varying(250)");
-
- b.Property("Value")
- .IsRequired()
- .HasMaxLength(2000)
- .HasColumnType("character varying(2000)");
-
- b.HasKey("Id");
-
- b.HasIndex("IdentityResourceId");
-
- b.ToTable("IdentityResourceProperties");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
- .WithMany("UserClaims")
- .HasForeignKey("ApiResourceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("ApiResource");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
- .WithMany("Properties")
- .HasForeignKey("ApiResourceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("ApiResource");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
- .WithMany("Scopes")
- .HasForeignKey("ApiResourceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("ApiResource");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
- .WithMany("Secrets")
- .HasForeignKey("ApiResourceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("ApiResource");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope")
- .WithMany("UserClaims")
- .HasForeignKey("ScopeId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Scope");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope")
- .WithMany("Properties")
- .HasForeignKey("ScopeId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Scope");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("Claims")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("AllowedCorsOrigins")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("AllowedGrantTypes")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("IdentityProviderRestrictions")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("PostLogoutRedirectUris")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("Properties")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("RedirectUris")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("AllowedScopes")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
- .WithMany("ClientSecrets")
- .HasForeignKey("ClientId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Client");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource")
- .WithMany("UserClaims")
- .HasForeignKey("IdentityResourceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("IdentityResource");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
- {
- b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource")
- .WithMany("Properties")
- .HasForeignKey("IdentityResourceId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("IdentityResource");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
- {
- b.Navigation("Properties");
-
- b.Navigation("Scopes");
-
- b.Navigation("Secrets");
-
- b.Navigation("UserClaims");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
- {
- b.Navigation("Properties");
-
- b.Navigation("UserClaims");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
- {
- b.Navigation("AllowedCorsOrigins");
-
- b.Navigation("AllowedGrantTypes");
-
- b.Navigation("AllowedScopes");
-
- b.Navigation("Claims");
-
- b.Navigation("ClientSecrets");
-
- b.Navigation("IdentityProviderRestrictions");
-
- b.Navigation("PostLogoutRedirectUris");
-
- b.Navigation("Properties");
-
- b.Navigation("RedirectUris");
- });
-
- modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
- {
- b.Navigation("Properties");
-
- b.Navigation("UserClaims");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Kyoo/Models/DatabaseMigrations/IdentityConfiguration/20210216205007_Initial.cs b/Kyoo/Models/DatabaseMigrations/IdentityConfiguration/20210216205007_Initial.cs
deleted file mode 100644
index fec7b0f0..00000000
--- a/Kyoo/Models/DatabaseMigrations/IdentityConfiguration/20210216205007_Initial.cs
+++ /dev/null
@@ -1,658 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-namespace Kyoo.Models.DatabaseMigrations.IdentityConfiguration
-{
- public partial class Initial : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "ApiResources",
- columns: table => new
- {
- Id = table.Column(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- Enabled = table.Column(type: "boolean", nullable: false),
- Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
- DisplayName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
- Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
- AllowedAccessTokenSigningAlgorithms = table.Column(type: "character varying(100)", maxLength: 100, nullable: true),
- ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false),
- Created = table.Column(type: "timestamp without time zone", nullable: false),
- Updated = table.Column(type: "timestamp without time zone", nullable: true),
- LastAccessed = table.Column(type: "timestamp without time zone", nullable: true),
- NonEditable = table.Column(type: "boolean", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ApiResources", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "ApiScopes",
- columns: table => new
- {
- Id = table.Column(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- Enabled = table.Column(type: "boolean", nullable: false),
- Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
- DisplayName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
- Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
- Required = table.Column(type: "boolean", nullable: false),
- Emphasize = table.Column(type: "boolean", nullable: false),
- ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ApiScopes", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Clients",
- columns: table => new
- {
- Id = table.Column(type: "integer", nullable: false)
- .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
- Enabled = table.Column(type: "boolean", nullable: false),
- ClientId = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
- ProtocolType = table.Column(type: "character varying(200)", maxLength: 200, nullable: false),
- RequireClientSecret = table.Column(type: "boolean", nullable: false),
- ClientName = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
- Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true),
- ClientUri = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
- LogoUri = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true),
- RequireConsent = table.Column(type: "boolean", nullable: false),
- AllowRememberConsent = table.Column(type: "boolean", nullable: false),
- AlwaysIncludeUserClaimsInIdToken = table.Column(type: "boolean", nullable: false),
- RequirePkce = table.Column(type: "boolean", nullable: false),
- AllowPlainTextPkce = table.Column