Add project files.
This commit is contained in:
+835
@@ -0,0 +1,835 @@
|
||||
// <auto-generated />
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
[DbContext(typeof(IdentityServerConfigurationDbContext))]
|
||||
[Migration("20191120100129_DbInit")]
|
||||
partial class DbInit
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.0.0")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResource", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("LastAccessed")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ApiResources");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Emphasize")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ApiScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiScopeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiScopeId");
|
||||
|
||||
b.ToTable("ApiScopeClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiSecret", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("Expiration")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(4000)")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiSecrets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("AbsoluteRefreshTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("AccessTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("AccessTokenType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("AllowAccessTokensViaBrowser")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowOfflineAccess")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowPlainTextPkce")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowRememberConsent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AlwaysSendClientClaims")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("AuthorizationCodeLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("BackChannelLogoutSessionRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("BackChannelLogoutUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<string>("ClientClaimsPrefix")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<int?>("ConsentLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int>("DeviceCodeLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("EnableLocalLogin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("FrontChannelLogoutSessionRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FrontChannelLogoutUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<int>("IdentityTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IncludeJwtId")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("LastAccessed")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("LogoUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("PairWiseSubjectSalt")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ProtocolType")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<int>("RefreshTokenExpiration")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("RefreshTokenUsage")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("RequireClientSecret")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequireConsent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequirePkce")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("SlidingRefreshTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("UserCodeType")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<int?>("UserSsoLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Origin")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(150)")
|
||||
.HasMaxLength(150);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientCorsOrigins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("GrantType")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientGrantTypes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Provider")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientIdPRestrictions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("PostLogoutRedirectUri")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientPostLogoutRedirectUris");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("RedirectUri")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientRedirectUris");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Scope")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<DateTime?>("Expiration")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(4000)")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientSecrets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("IdentityResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityResourceId");
|
||||
|
||||
b.ToTable("IdentityClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Emphasize")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("IdentityResources");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("IdentityResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityResourceId");
|
||||
|
||||
b.ToTable("IdentityProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScope", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Scopes")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "ApiScope")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("ApiScopeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiSecret", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Secrets")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedCorsOrigins")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedGrantTypes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("IdentityProviderRestrictions")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("PostLogoutRedirectUris")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("RedirectUris")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedScopes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("ClientSecrets")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("IdentityResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("IdentityResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
+608
@@ -0,0 +1,608 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
public partial class DbInit : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiResources",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Enabled = table.Column<bool>(nullable: false),
|
||||
Name = table.Column<string>(maxLength: 200, nullable: false),
|
||||
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
|
||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
||||
Created = table.Column<DateTime>(nullable: false),
|
||||
Updated = table.Column<DateTime>(nullable: true),
|
||||
LastAccessed = table.Column<DateTime>(nullable: true),
|
||||
NonEditable = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiResources", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Clients",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Enabled = table.Column<bool>(nullable: false),
|
||||
ClientId = table.Column<string>(maxLength: 200, nullable: false),
|
||||
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
|
||||
RequireClientSecret = table.Column<bool>(nullable: false),
|
||||
ClientName = table.Column<string>(maxLength: 200, nullable: true),
|
||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
||||
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
|
||||
LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
|
||||
RequireConsent = table.Column<bool>(nullable: false),
|
||||
AllowRememberConsent = table.Column<bool>(nullable: false),
|
||||
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
|
||||
RequirePkce = table.Column<bool>(nullable: false),
|
||||
AllowPlainTextPkce = table.Column<bool>(nullable: false),
|
||||
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
|
||||
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
|
||||
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
|
||||
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
|
||||
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
|
||||
AllowOfflineAccess = table.Column<bool>(nullable: false),
|
||||
IdentityTokenLifetime = table.Column<int>(nullable: false),
|
||||
AccessTokenLifetime = table.Column<int>(nullable: false),
|
||||
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
|
||||
ConsentLifetime = table.Column<int>(nullable: true),
|
||||
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
|
||||
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
|
||||
RefreshTokenUsage = table.Column<int>(nullable: false),
|
||||
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false),
|
||||
RefreshTokenExpiration = table.Column<int>(nullable: false),
|
||||
AccessTokenType = table.Column<int>(nullable: false),
|
||||
EnableLocalLogin = table.Column<bool>(nullable: false),
|
||||
IncludeJwtId = table.Column<bool>(nullable: false),
|
||||
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
|
||||
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
|
||||
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true),
|
||||
Created = table.Column<DateTime>(nullable: false),
|
||||
Updated = table.Column<DateTime>(nullable: true),
|
||||
LastAccessed = table.Column<DateTime>(nullable: true),
|
||||
UserSsoLifetime = table.Column<int>(nullable: true),
|
||||
UserCodeType = table.Column<string>(maxLength: 100, nullable: true),
|
||||
DeviceCodeLifetime = table.Column<int>(nullable: false),
|
||||
NonEditable = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Clients", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IdentityResources",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Enabled = table.Column<bool>(nullable: false),
|
||||
Name = table.Column<string>(maxLength: 200, nullable: false),
|
||||
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
|
||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
||||
Required = table.Column<bool>(nullable: false),
|
||||
Emphasize = table.Column<bool>(nullable: false),
|
||||
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
|
||||
Created = table.Column<DateTime>(nullable: false),
|
||||
Updated = table.Column<DateTime>(nullable: true),
|
||||
NonEditable = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IdentityResources", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Type = table.Column<string>(maxLength: 200, nullable: false),
|
||||
ApiResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiClaims_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiProperties",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Value = table.Column<string>(maxLength: 2000, nullable: false),
|
||||
ApiResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiProperties", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiProperties_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiScopes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Name = table.Column<string>(maxLength: 200, nullable: false),
|
||||
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
|
||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
||||
Required = table.Column<bool>(nullable: false),
|
||||
Emphasize = table.Column<bool>(nullable: false),
|
||||
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
|
||||
ApiResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiScopes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiScopes_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiSecrets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
||||
Value = table.Column<string>(maxLength: 4000, nullable: false),
|
||||
Expiration = table.Column<DateTime>(nullable: true),
|
||||
Type = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Created = table.Column<DateTime>(nullable: false),
|
||||
ApiResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiSecrets", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiSecrets_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Type = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Value = table.Column<string>(maxLength: 250, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientClaims_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientCorsOrigins",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Origin = table.Column<string>(maxLength: 150, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientCorsOrigins", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientCorsOrigins_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientGrantTypes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
GrantType = table.Column<string>(maxLength: 250, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientGrantTypes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientGrantTypes_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientIdPRestrictions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Provider = table.Column<string>(maxLength: 200, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientIdPRestrictions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientIdPRestrictions_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientPostLogoutRedirectUris",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
PostLogoutRedirectUri = table.Column<string>(maxLength: 2000, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientPostLogoutRedirectUris", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientPostLogoutRedirectUris_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientProperties",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Value = table.Column<string>(maxLength: 2000, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientProperties", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientProperties_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientRedirectUris",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
RedirectUri = table.Column<string>(maxLength: 2000, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientRedirectUris", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientRedirectUris_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientScopes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Scope = table.Column<string>(maxLength: 200, nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientScopes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientScopes_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientSecrets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Description = table.Column<string>(maxLength: 2000, nullable: true),
|
||||
Value = table.Column<string>(maxLength: 4000, nullable: false),
|
||||
Expiration = table.Column<DateTime>(nullable: true),
|
||||
Type = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Created = table.Column<DateTime>(nullable: false),
|
||||
ClientId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientSecrets", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientSecrets_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IdentityClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Type = table.Column<string>(maxLength: 200, nullable: false),
|
||||
IdentityResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IdentityClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_IdentityClaims_IdentityResources_IdentityResourceId",
|
||||
column: x => x.IdentityResourceId,
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IdentityProperties",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Value = table.Column<string>(maxLength: 2000, nullable: false),
|
||||
IdentityResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IdentityProperties", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_IdentityProperties_IdentityResources_IdentityResourceId",
|
||||
column: x => x.IdentityResourceId,
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiScopeClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Type = table.Column<string>(maxLength: 200, nullable: false),
|
||||
ApiScopeId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiScopeClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId",
|
||||
column: x => x.ApiScopeId,
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiClaims_ApiResourceId",
|
||||
table: "ApiClaims",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiProperties_ApiResourceId",
|
||||
table: "ApiProperties",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResources_Name",
|
||||
table: "ApiResources",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeClaims_ApiScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ApiScopeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopes_ApiResourceId",
|
||||
table: "ApiScopes",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopes_Name",
|
||||
table: "ApiScopes",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiSecrets_ApiResourceId",
|
||||
table: "ApiSecrets",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientClaims_ClientId",
|
||||
table: "ClientClaims",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientCorsOrigins_ClientId",
|
||||
table: "ClientCorsOrigins",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientGrantTypes_ClientId",
|
||||
table: "ClientGrantTypes",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientIdPRestrictions_ClientId",
|
||||
table: "ClientIdPRestrictions",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientPostLogoutRedirectUris_ClientId",
|
||||
table: "ClientPostLogoutRedirectUris",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientProperties_ClientId",
|
||||
table: "ClientProperties",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientRedirectUris_ClientId",
|
||||
table: "ClientRedirectUris",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Clients_ClientId",
|
||||
table: "Clients",
|
||||
column: "ClientId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientScopes_ClientId",
|
||||
table: "ClientScopes",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientSecrets_ClientId",
|
||||
table: "ClientSecrets",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityClaims_IdentityResourceId",
|
||||
table: "IdentityClaims",
|
||||
column: "IdentityResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityProperties_IdentityResourceId",
|
||||
table: "IdentityProperties",
|
||||
column: "IdentityResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityResources_Name",
|
||||
table: "IdentityResources",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiProperties");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiSecrets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientCorsOrigins");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientGrantTypes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientIdPRestrictions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientPostLogoutRedirectUris");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientProperties");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientRedirectUris");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientScopes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientSecrets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "IdentityClaims");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "IdentityProperties");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Clients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "IdentityResources");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiResources");
|
||||
}
|
||||
}
|
||||
}
|
||||
+905
@@ -0,0 +1,905 @@
|
||||
// <auto-generated />
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
[DbContext(typeof(IdentityServerConfigurationDbContext))]
|
||||
[Migration("20201108170812_UpdateIdentityServerToVersion4")]
|
||||
partial class UpdateIdentityServerToVersion4
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.1.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResource", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("AllowedAccessTokenSigningAlgorithms")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("LastAccessed")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ApiResources");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Scope")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceSecret", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("Expiration")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(4000)")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceSecrets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Emphasize")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ApiScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ScopeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ScopeId");
|
||||
|
||||
b.ToTable("ApiScopeClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<int>("ScopeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ScopeId");
|
||||
|
||||
b.ToTable("ApiScopeProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("AbsoluteRefreshTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("AccessTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("AccessTokenType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("AllowAccessTokensViaBrowser")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowOfflineAccess")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowPlainTextPkce")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowRememberConsent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("AllowedIdentityTokenSigningAlgorithms")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AlwaysSendClientClaims")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("AuthorizationCodeLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("BackChannelLogoutSessionRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("BackChannelLogoutUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<string>("ClientClaimsPrefix")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<int?>("ConsentLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int>("DeviceCodeLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("EnableLocalLogin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("FrontChannelLogoutSessionRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FrontChannelLogoutUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<int>("IdentityTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IncludeJwtId")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("LastAccessed")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("LogoUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("PairWiseSubjectSalt")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ProtocolType")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<int>("RefreshTokenExpiration")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("RefreshTokenUsage")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("RequireClientSecret")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequireConsent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequirePkce")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequireRequestObject")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("SlidingRefreshTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("UserCodeType")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<int?>("UserSsoLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Origin")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(150)")
|
||||
.HasMaxLength(150);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientCorsOrigins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("GrantType")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientGrantTypes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Provider")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientIdPRestrictions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("PostLogoutRedirectUri")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientPostLogoutRedirectUris");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("RedirectUri")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientRedirectUris");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Scope")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<DateTime?>("Expiration")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(4000)")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientSecrets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Emphasize")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("IdentityResources");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("IdentityResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityResourceId");
|
||||
|
||||
b.ToTable("IdentityResourceClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("IdentityResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityResourceId");
|
||||
|
||||
b.ToTable("IdentityResourceProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceScope", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Scopes")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceSecret", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Secrets")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "Scope")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("ScopeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "Scope")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ScopeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedCorsOrigins")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedGrantTypes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("IdentityProviderRestrictions")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("PostLogoutRedirectUris")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("RedirectUris")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedScopes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("ClientSecrets")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("IdentityResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("IdentityResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
+563
@@ -0,0 +1,563 @@
|
||||
// Original SQL scripts for database migration come from: https://github.com/RockSolidKnowledge/IdentityServer4.Migration.Scripts/blob/master/Postgres/ConfigurationDbContext.sql
|
||||
// Modified by Jan Škoruba
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
public partial class UpdateIdentityServerToVersion4 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiClaims_ApiResources_ApiResourceId",
|
||||
table: "ApiClaims");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiProperties_ApiResources_ApiResourceId",
|
||||
table: "ApiProperties");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopes_ApiResources_ApiResourceId",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityProperties_IdentityResources_IdentityResourceId",
|
||||
table: "IdentityProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopes_ApiResourceId",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopeClaims_ApiScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_IdentityProperties",
|
||||
table: "IdentityProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiProperties",
|
||||
table: "ApiProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiClaims",
|
||||
table: "ApiClaims");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "IdentityProperties",
|
||||
newName: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiProperties",
|
||||
newName: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiClaims",
|
||||
newName: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_IdentityProperties_IdentityResourceId",
|
||||
table: "IdentityResourceProperties",
|
||||
newName: "IX_IdentityResourceProperties_IdentityResourceId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiProperties_ApiResourceId",
|
||||
table: "ApiResourceProperties",
|
||||
newName: "IX_ApiResourceProperties_ApiResourceId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiClaims_ApiResourceId",
|
||||
table: "ApiResourceClaims",
|
||||
newName: "IX_ApiResourceClaims_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AllowedIdentityTokenSigningAlgorithms",
|
||||
table: "Clients",
|
||||
maxLength: 100,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "RequireRequestObject",
|
||||
table: "Clients",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Enabled",
|
||||
table: "ApiScopes",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "AllowedAccessTokenSigningAlgorithms",
|
||||
table: "ApiResources",
|
||||
maxLength: 100,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ShowInDiscoveryDocument",
|
||||
table: "ApiResources",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_IdentityResourceProperties",
|
||||
table: "IdentityResourceProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceProperties",
|
||||
table: "ApiResourceProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceClaims",
|
||||
table: "ApiResourceClaims",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiResourceScopes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Scope = table.Column<string>(maxLength: 200, nullable: false),
|
||||
ApiResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiResourceScopes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiResourceScopes_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiResourceSecrets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
||||
Value = table.Column<string>(maxLength: 4000, nullable: false),
|
||||
Expiration = table.Column<DateTime>(nullable: true),
|
||||
Type = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Created = table.Column<DateTime>(nullable: false),
|
||||
ApiResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiResourceSecrets", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiScopeProperties",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Key = table.Column<string>(maxLength: 250, nullable: false),
|
||||
Value = table.Column<string>(maxLength: 2000, nullable: false),
|
||||
ScopeId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiScopeProperties", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiScopeProperties_ApiScopes_ScopeId",
|
||||
column: x => x.ScopeId,
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IdentityResourceClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Type = table.Column<string>(maxLength: 200, nullable: false),
|
||||
IdentityResourceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IdentityResourceClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId",
|
||||
column: x => x.IdentityResourceId,
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ScopeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceScopes_ApiResourceId",
|
||||
table: "ApiResourceScopes",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceSecrets_ApiResourceId",
|
||||
table: "ApiResourceSecrets",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeProperties_ScopeId",
|
||||
table: "ApiScopeProperties",
|
||||
column: "ScopeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityResourceClaims_IdentityResourceId",
|
||||
table: "IdentityResourceClaims",
|
||||
column: "IdentityResourceId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceClaims_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceClaims",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
// migrate data
|
||||
|
||||
migrationBuilder.Sql(@"INSERT INTO ""ApiResourceSecrets""
|
||||
(""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId"")
|
||||
SELECT
|
||||
""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId""
|
||||
FROM ""ApiSecrets"";");
|
||||
|
||||
migrationBuilder.Sql(@"INSERT INTO ""IdentityResourceClaims""
|
||||
(""Id"", ""Type"", ""IdentityResourceId"")
|
||||
SELECT
|
||||
""Id"", ""Type"", ""IdentityResourceId""
|
||||
FROM ""IdentityClaims"";");
|
||||
|
||||
migrationBuilder.Sql(@"INSERT INTO ""ApiResourceScopes""
|
||||
(""Scope"", ""ApiResourceId"")
|
||||
SELECT
|
||||
""Name"", ""ApiResourceId""
|
||||
FROM ""ApiScopes"";");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE ""ApiScopeClaims"" SET ""ScopeId"" = ""ApiScopeId"";");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE ""ApiScopes"" SET ""Enabled"" = TRUE;");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiSecrets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "IdentityClaims");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApiResourceId",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ApiScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceProperties_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceProperties",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ScopeId",
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityResourceProperties_IdentityResources_IdentityResour~",
|
||||
table: "IdentityResourceProperties",
|
||||
column: "IdentityResourceId",
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceClaims_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceProperties_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityResourceProperties_IdentityResources_IdentityResour~",
|
||||
table: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_IdentityResourceProperties",
|
||||
table: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceProperties",
|
||||
table: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceClaims",
|
||||
table: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "IdentityResourceProperties",
|
||||
newName: "IdentityProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceProperties",
|
||||
newName: "ApiProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceClaims",
|
||||
newName: "ApiClaims");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_IdentityResourceProperties_IdentityResourceId",
|
||||
table: "IdentityProperties",
|
||||
newName: "IX_IdentityProperties_IdentityResourceId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceProperties_ApiResourceId",
|
||||
table: "ApiProperties",
|
||||
newName: "IX_ApiProperties_ApiResourceId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceClaims_ApiResourceId",
|
||||
table: "ApiClaims",
|
||||
newName: "IX_ApiClaims_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ApiResourceId",
|
||||
table: "ApiScopes",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ApiScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_IdentityProperties",
|
||||
table: "IdentityProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiProperties",
|
||||
table: "ApiProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiClaims",
|
||||
table: "ApiClaims",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ApiSecrets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ApiResourceId = table.Column<int>(type: "integer", nullable: false),
|
||||
Created = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
Description = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
|
||||
Expiration = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
Type = table.Column<string>(type: "character varying(250)", maxLength: 250, nullable: false),
|
||||
Value = table.Column<string>(type: "character varying(4000)", maxLength: 4000, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ApiSecrets", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ApiSecrets_ApiResources_ApiResourceId",
|
||||
column: x => x.ApiResourceId,
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IdentityClaims",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
IdentityResourceId = table.Column<int>(type: "integer", nullable: false),
|
||||
Type = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IdentityClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_IdentityClaims_IdentityResources_IdentityResourceId",
|
||||
column: x => x.IdentityResourceId,
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopes_ApiResourceId",
|
||||
table: "ApiScopes",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeClaims_ApiScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ApiScopeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiSecrets_ApiResourceId",
|
||||
table: "ApiSecrets",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityClaims_IdentityResourceId",
|
||||
table: "IdentityClaims",
|
||||
column: "IdentityResourceId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiClaims_ApiResources_ApiResourceId",
|
||||
table: "ApiClaims",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiProperties_ApiResources_ApiResourceId",
|
||||
table: "ApiProperties",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
// Rollback data back
|
||||
migrationBuilder.Sql(@"INSERT INTO ""ApiSecrets""
|
||||
(""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId"")
|
||||
SELECT ""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId""
|
||||
FROM ""ApiResourceSecrets"";");
|
||||
|
||||
migrationBuilder.Sql(@"INSERT INTO ""IdentityClaims""
|
||||
(""Id"", ""Type"", ""IdentityResourceId"")
|
||||
SELECT
|
||||
""Id"", ""Type"", ""IdentityResourceId""
|
||||
FROM ""IdentityResourceClaims"";");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE ""ApiScopes"" asp
|
||||
SET ""ApiResourceId"" = arc.""ApiResourceId""
|
||||
FROM ""ApiResourceScopes"" arc
|
||||
WHERE arc.""Id"" = asp.""Id"";");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE ""ApiScopeClaims"" SET ""ApiScopeId"" = ""ScopeId"";");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiResourceScopes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiResourceSecrets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApiScopeProperties");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "IdentityResourceClaims");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowedIdentityTokenSigningAlgorithms",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RequireRequestObject",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Enabled",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AllowedAccessTokenSigningAlgorithms",
|
||||
table: "ApiResources");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShowInDiscoveryDocument",
|
||||
table: "ApiResources");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ApiScopeId",
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopes_ApiResources_ApiResourceId",
|
||||
table: "ApiScopes",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityProperties_IdentityResources_IdentityResourceId",
|
||||
table: "IdentityProperties",
|
||||
column: "IdentityResourceId",
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
+908
@@ -0,0 +1,908 @@
|
||||
// <auto-generated />
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using LiteCharmsSecurity.Admin.EntityFramework.Shared.DbContexts;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
[DbContext(typeof(IdentityServerConfigurationDbContext))]
|
||||
[Migration("20210310153645_AddRequireResourceIndicator")]
|
||||
partial class AddRequireResourceIndicator
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.1.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResource", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("AllowedAccessTokenSigningAlgorithms")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("LastAccessed")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequireResourceIndicator")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ApiResources");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Scope")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceSecret", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ApiResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<DateTime?>("Expiration")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(4000)")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApiResourceId");
|
||||
|
||||
b.ToTable("ApiResourceSecrets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Emphasize")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("ApiScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ScopeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ScopeId");
|
||||
|
||||
b.ToTable("ApiScopeClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<int>("ScopeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ScopeId");
|
||||
|
||||
b.ToTable("ApiScopeProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("AbsoluteRefreshTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("AccessTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("AccessTokenType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("AllowAccessTokensViaBrowser")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowOfflineAccess")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowPlainTextPkce")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AllowRememberConsent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("AllowedIdentityTokenSigningAlgorithms")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("AlwaysSendClientClaims")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("AuthorizationCodeLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("BackChannelLogoutSessionRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("BackChannelLogoutUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<string>("ClientClaimsPrefix")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ClientUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<int?>("ConsentLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<int>("DeviceCodeLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("EnableLocalLogin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("FrontChannelLogoutSessionRequired")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FrontChannelLogoutUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<int>("IdentityTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IncludeJwtId")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("LastAccessed")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("LogoUri")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("PairWiseSubjectSalt")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<string>("ProtocolType")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<int>("RefreshTokenExpiration")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("RefreshTokenUsage")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("RequireClientSecret")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequireConsent")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequirePkce")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("RequireRequestObject")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("SlidingRefreshTokenLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("UserCodeType")
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasMaxLength(100);
|
||||
|
||||
b.Property<int?>("UserSsoLifetime")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Origin")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(150)")
|
||||
.HasMaxLength(150);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientCorsOrigins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("GrantType")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientGrantTypes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Provider")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientIdPRestrictions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("PostLogoutRedirectUri")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientPostLogoutRedirectUris");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("RedirectUri")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientRedirectUris");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Scope")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientScopes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.Property<DateTime?>("Expiration")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(4000)")
|
||||
.HasMaxLength(4000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("ClientSecrets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("character varying(1000)")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("Emphasize")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.Property<bool>("NonEditable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("Required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("ShowInDiscoveryDocument")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime?>("Updated")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("IdentityResources");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceClaim", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("IdentityResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasMaxLength(200);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityResourceId");
|
||||
|
||||
b.ToTable("IdentityResourceClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("IdentityResourceId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(250)")
|
||||
.HasMaxLength(250);
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("character varying(2000)")
|
||||
.HasMaxLength(2000);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdentityResourceId");
|
||||
|
||||
b.ToTable("IdentityResourceProperties");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceScope", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Scopes")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiResourceSecret", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiResource", "ApiResource")
|
||||
.WithMany("Secrets")
|
||||
.HasForeignKey("ApiResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "Scope")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("ScopeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ApiScopeProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.ApiScope", "Scope")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ScopeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("Claims")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientCorsOrigin", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedCorsOrigins")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientGrantType", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedGrantTypes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientIdPRestriction", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("IdentityProviderRestrictions")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("PostLogoutRedirectUris")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("RedirectUris")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientScope", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("AllowedScopes")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.ClientSecret", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.Client", "Client")
|
||||
.WithMany("ClientSecrets")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceClaim", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
|
||||
.WithMany("UserClaims")
|
||||
.HasForeignKey("IdentityResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.IdentityResourceProperty", b =>
|
||||
{
|
||||
b.HasOne("Duende.IdentityServer.EntityFramework.Entities.IdentityResource", "IdentityResource")
|
||||
.WithMany("Properties")
|
||||
.HasForeignKey("IdentityResourceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
public partial class AddRequireResourceIndicator : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "RequireResourceIndicator",
|
||||
table: "ApiResources",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RequireResourceIndicator",
|
||||
table: "ApiResources");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1020
File diff suppressed because it is too large
Load Diff
+34
@@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
public partial class UpdateISKeysIDP : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "IdentityProviders",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
Scheme = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||||
DisplayName = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: true),
|
||||
Enabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Type = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
|
||||
Properties = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_IdentityProviders", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "IdentityProviders");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1093
File diff suppressed because it is too large
Load Diff
+455
@@ -0,0 +1,455 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
public partial class UpdateToIS6 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityResourceProperties_IdentityResourceId",
|
||||
table: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityResourceClaims_IdentityResourceId",
|
||||
table: "IdentityResourceClaims");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientScopes_ClientId",
|
||||
table: "ClientScopes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientRedirectUris_ClientId",
|
||||
table: "ClientRedirectUris");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientProperties_ClientId",
|
||||
table: "ClientProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientPostLogoutRedirectUris_ClientId",
|
||||
table: "ClientPostLogoutRedirectUris");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientIdPRestrictions_ClientId",
|
||||
table: "ClientIdPRestrictions");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientGrantTypes_ClientId",
|
||||
table: "ClientGrantTypes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientCorsOrigins_ClientId",
|
||||
table: "ClientCorsOrigins");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientClaims_ClientId",
|
||||
table: "ClientClaims");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopeProperties_ScopeId",
|
||||
table: "ApiScopeProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiResourceScopes_ApiResourceId",
|
||||
table: "ApiResourceScopes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiResourceProperties_ApiResourceId",
|
||||
table: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiResourceClaims_ApiResourceId",
|
||||
table: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Created",
|
||||
table: "IdentityProviders",
|
||||
type: "timestamp without time zone",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LastAccessed",
|
||||
table: "IdentityProviders",
|
||||
type: "timestamp without time zone",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "NonEditable",
|
||||
table: "IdentityProviders",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Updated",
|
||||
table: "IdentityProviders",
|
||||
type: "timestamp without time zone",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "CibaLifetime",
|
||||
table: "Clients",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PollingInterval",
|
||||
table: "Clients",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RedirectUri",
|
||||
table: "ClientRedirectUris",
|
||||
type: "character varying(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(2000)",
|
||||
oldMaxLength: 2000);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "PostLogoutRedirectUri",
|
||||
table: "ClientPostLogoutRedirectUris",
|
||||
type: "character varying(400)",
|
||||
maxLength: 400,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(2000)",
|
||||
oldMaxLength: 2000);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Created",
|
||||
table: "ApiScopes",
|
||||
type: "timestamp without time zone",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "LastAccessed",
|
||||
table: "ApiScopes",
|
||||
type: "timestamp without time zone",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "NonEditable",
|
||||
table: "ApiScopes",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Updated",
|
||||
table: "ApiScopes",
|
||||
type: "timestamp without time zone",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityResourceProperties_IdentityResourceId_Key",
|
||||
table: "IdentityResourceProperties",
|
||||
columns: new[] { "IdentityResourceId", "Key" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityResourceClaims_IdentityResourceId_Type",
|
||||
table: "IdentityResourceClaims",
|
||||
columns: new[] { "IdentityResourceId", "Type" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityProviders_Scheme",
|
||||
table: "IdentityProviders",
|
||||
column: "Scheme",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientScopes_ClientId_Scope",
|
||||
table: "ClientScopes",
|
||||
columns: new[] { "ClientId", "Scope" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientRedirectUris_ClientId_RedirectUri",
|
||||
table: "ClientRedirectUris",
|
||||
columns: new[] { "ClientId", "RedirectUri" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientProperties_ClientId_Key",
|
||||
table: "ClientProperties",
|
||||
columns: new[] { "ClientId", "Key" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientPostLogoutRedirectUris_ClientId_PostLogoutRedirectUri",
|
||||
table: "ClientPostLogoutRedirectUris",
|
||||
columns: new[] { "ClientId", "PostLogoutRedirectUri" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientIdPRestrictions_ClientId_Provider",
|
||||
table: "ClientIdPRestrictions",
|
||||
columns: new[] { "ClientId", "Provider" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientGrantTypes_ClientId_GrantType",
|
||||
table: "ClientGrantTypes",
|
||||
columns: new[] { "ClientId", "GrantType" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientCorsOrigins_ClientId_Origin",
|
||||
table: "ClientCorsOrigins",
|
||||
columns: new[] { "ClientId", "Origin" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientClaims_ClientId_Type_Value",
|
||||
table: "ClientClaims",
|
||||
columns: new[] { "ClientId", "Type", "Value" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeProperties_ScopeId_Key",
|
||||
table: "ApiScopeProperties",
|
||||
columns: new[] { "ScopeId", "Key" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId_Type",
|
||||
table: "ApiScopeClaims",
|
||||
columns: new[] { "ScopeId", "Type" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceScopes_ApiResourceId_Scope",
|
||||
table: "ApiResourceScopes",
|
||||
columns: new[] { "ApiResourceId", "Scope" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceProperties_ApiResourceId_Key",
|
||||
table: "ApiResourceProperties",
|
||||
columns: new[] { "ApiResourceId", "Key" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceClaims_ApiResourceId_Type",
|
||||
table: "ApiResourceClaims",
|
||||
columns: new[] { "ApiResourceId", "Type" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityResourceProperties_IdentityResourceId_Key",
|
||||
table: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityResourceClaims_IdentityResourceId_Type",
|
||||
table: "IdentityResourceClaims");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityProviders_Scheme",
|
||||
table: "IdentityProviders");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientScopes_ClientId_Scope",
|
||||
table: "ClientScopes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientRedirectUris_ClientId_RedirectUri",
|
||||
table: "ClientRedirectUris");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientProperties_ClientId_Key",
|
||||
table: "ClientProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientPostLogoutRedirectUris_ClientId_PostLogoutRedirectUri",
|
||||
table: "ClientPostLogoutRedirectUris");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientIdPRestrictions_ClientId_Provider",
|
||||
table: "ClientIdPRestrictions");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientGrantTypes_ClientId_GrantType",
|
||||
table: "ClientGrantTypes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientCorsOrigins_ClientId_Origin",
|
||||
table: "ClientCorsOrigins");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ClientClaims_ClientId_Type_Value",
|
||||
table: "ClientClaims");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopeProperties_ScopeId_Key",
|
||||
table: "ApiScopeProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId_Type",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiResourceScopes_ApiResourceId_Scope",
|
||||
table: "ApiResourceScopes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiResourceProperties_ApiResourceId_Key",
|
||||
table: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ApiResourceClaims_ApiResourceId_Type",
|
||||
table: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Created",
|
||||
table: "IdentityProviders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastAccessed",
|
||||
table: "IdentityProviders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "NonEditable",
|
||||
table: "IdentityProviders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Updated",
|
||||
table: "IdentityProviders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CibaLifetime",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PollingInterval",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Created",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LastAccessed",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "NonEditable",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Updated",
|
||||
table: "ApiScopes");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RedirectUri",
|
||||
table: "ClientRedirectUris",
|
||||
type: "character varying(2000)",
|
||||
maxLength: 2000,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "PostLogoutRedirectUri",
|
||||
table: "ClientPostLogoutRedirectUris",
|
||||
type: "character varying(2000)",
|
||||
maxLength: 2000,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "character varying(400)",
|
||||
oldMaxLength: 400);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityResourceProperties_IdentityResourceId",
|
||||
table: "IdentityResourceProperties",
|
||||
column: "IdentityResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityResourceClaims_IdentityResourceId",
|
||||
table: "IdentityResourceClaims",
|
||||
column: "IdentityResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientScopes_ClientId",
|
||||
table: "ClientScopes",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientRedirectUris_ClientId",
|
||||
table: "ClientRedirectUris",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientProperties_ClientId",
|
||||
table: "ClientProperties",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientPostLogoutRedirectUris_ClientId",
|
||||
table: "ClientPostLogoutRedirectUris",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientIdPRestrictions_ClientId",
|
||||
table: "ClientIdPRestrictions",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientGrantTypes_ClientId",
|
||||
table: "ClientGrantTypes",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientCorsOrigins_ClientId",
|
||||
table: "ClientCorsOrigins",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientClaims_ClientId",
|
||||
table: "ClientClaims",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeProperties_ScopeId",
|
||||
table: "ApiScopeProperties",
|
||||
column: "ScopeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ScopeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceScopes_ApiResourceId",
|
||||
table: "ApiResourceScopes",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceProperties_ApiResourceId",
|
||||
table: "ApiResourceProperties",
|
||||
column: "ApiResourceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApiResourceClaims_ApiResourceId",
|
||||
table: "ApiResourceClaims",
|
||||
column: "ApiResourceId");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1096
File diff suppressed because it is too large
Load Diff
+25
@@ -0,0 +1,25 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
public partial class UpdateToIS61 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CoordinateLifetimeWithUserSession",
|
||||
table: "Clients",
|
||||
type: "boolean",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CoordinateLifetimeWithUserSession",
|
||||
table: "Clients");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1116
File diff suppressed because it is too large
Load Diff
+84
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LiteCharmsSecurity.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class IdentityServerV7 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<TimeSpan>(
|
||||
name: "DPoPClockSkew",
|
||||
table: "Clients",
|
||||
type: "interval",
|
||||
nullable: false,
|
||||
defaultValue: new TimeSpan(0, 0, 0, 0, 0));
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "DPoPValidationMode",
|
||||
table: "Clients",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "InitiateLoginUri",
|
||||
table: "Clients",
|
||||
type: "character varying(2000)",
|
||||
maxLength: 2000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PushedAuthorizationLifetime",
|
||||
table: "Clients",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "RequireDPoP",
|
||||
table: "Clients",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "RequirePushedAuthorization",
|
||||
table: "Clients",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DPoPClockSkew",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DPoPValidationMode",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "InitiateLoginUri",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PushedAuthorizationLifetime",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RequireDPoP",
|
||||
table: "Clients");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RequirePushedAuthorization",
|
||||
table: "Clients");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1113
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user