From cee969f7bb80f61a3f85b7a51a347ca951635677 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Tue, 7 Jul 2020 16:07:20 +0800 Subject: [PATCH] Recreate Template projects migrations. --- .../ApiResources/ApiResourceConsts.cs | 6 +- .../ApiResourceSecretConsts.cs} | 4 +- .../IdentityServer/Clients/ClientConsts.cs | 2 + .../Clients/ClientSecretConsts.cs | 20 ++ .../IdentityServer/Clients/ClientProperty.cs | 4 +- ...yServerDbContextModelCreatingExtensions.cs | 29 +- ....cs => 20200707075540_Initial.Designer.cs} | 24 +- ...0_Initial.cs => 20200707075540_Initial.cs} | 14 +- ...ectNameMigrationsDbContextModelSnapshot.cs | 22 +- ....cs => 20200707075532_Initial.Designer.cs} | 294 ++++++++++++++---- ...1_Initial.cs => 20200707075532_Initial.cs} | 217 ++++++++++--- ...verHostMigrationsDbContextModelSnapshot.cs | 292 +++++++++++++---- ....cs => 20200707075539_Initial.Designer.cs} | 2 +- ...0_Initial.cs => 20200707075539_Initial.cs} | 0 14 files changed, 706 insertions(+), 224 deletions(-) rename modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/{SecretConsts.cs => ApiResources/ApiResourceSecretConsts.cs} (82%) create mode 100644 modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientSecretConsts.cs rename templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/{20200707050900_Initial.Designer.cs => 20200707075540_Initial.Designer.cs} (99%) rename templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/{20200707050900_Initial.cs => 20200707075540_Initial.cs} (99%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/{20200624023331_Initial.Designer.cs => 20200707075532_Initial.Designer.cs} (89%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/{20200624023331_Initial.cs => 20200707075532_Initial.cs} (87%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/{20200624023340_Initial.Designer.cs => 20200707075539_Initial.Designer.cs} (99%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/{20200624023340_Initial.cs => 20200707075539_Initial.cs} (100%) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs index 9a023c435b..05719fbc8f 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceConsts.cs @@ -4,8 +4,10 @@ { public static int NameMaxLength { get; set; } = 200; - public static int DisplayNameMaxLength { get; set; } = 200; + public static int DisplayNameMaxLength { get; set; } = 200; - public static int DescriptionMaxLength { get; set; } = 1000; + public static int DescriptionMaxLength { get; set; } = 1000; + + public static int AllowedAccessTokenSigningAlgorithmsMaxLength { get; set; } = 100; } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceSecretConsts.cs similarity index 82% rename from modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs rename to modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceSecretConsts.cs index f3b7f2c5df..523bc147b1 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceSecretConsts.cs @@ -1,6 +1,6 @@ -namespace Volo.Abp.IdentityServer +namespace Volo.Abp.IdentityServer.ApiResources { - public class SecretConsts + public class ApiResourceSecretConsts { /// /// Default value: 250 diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs index 4331ab7064..e76411d0ed 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientConsts.cs @@ -23,5 +23,7 @@ public static int PairWiseSubjectSaltMaxLength { get; set; } = 200; public static int UserCodeTypeMaxLength { get; set; } = 100; + + public static int AllowedIdentityTokenSigningAlgorithms { get; set; } = 100; } } diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientSecretConsts.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientSecretConsts.cs new file mode 100644 index 0000000000..60eb0807d1 --- /dev/null +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientSecretConsts.cs @@ -0,0 +1,20 @@ +namespace Volo.Abp.IdentityServer.Clients +{ + public class ClientSecretConsts + { + /// + /// Default value: 250 + /// + public static int TypeMaxLength { get; set; } = 250; + + /// + /// Default value: 4000 + /// + public static int ValueMaxLength { get; set; } = 4000; + + /// + /// Default value: 2000 + /// + public static int DescriptionMaxLength { get; set; } = 2000; + } +} diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs index daddd94e83..7347f1cc7c 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/Clients/ClientProperty.cs @@ -17,7 +17,7 @@ namespace Volo.Abp.IdentityServer.Clients } - public virtual bool Equals(Guid clientId, [NotNull] string key, string value) + public virtual bool Equals(Guid clientId, [NotNull] string key, [NotNull] string value) { return ClientId == clientId && Key == key && Value == value; } @@ -36,4 +36,4 @@ namespace Volo.Abp.IdentityServer.Clients return new object[] { ClientId, Key }; } } -} \ No newline at end of file +} diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs index e78ac0bc95..20a99c082e 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs @@ -50,6 +50,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.Property(x => x.ClientClaimsPrefix).HasMaxLength(ClientConsts.ClientClaimsPrefixMaxLength); b.Property(x => x.PairWiseSubjectSalt).HasMaxLength(ClientConsts.PairWiseSubjectSaltMaxLength); b.Property(x => x.UserCodeType).HasMaxLength(ClientConsts.UserCodeTypeMaxLength); + b.Property(x => x.AllowedIdentityTokenSigningAlgorithms).HasMaxLength(ClientConsts.AllowedIdentityTokenSigningAlgorithms); b.HasMany(x => x.AllowedScopes).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); b.HasMany(x => x.ClientSecrets).WithOne().HasForeignKey(x => x.ClientId).IsRequired(); @@ -128,16 +129,13 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ClientId, x.Type, x.Value}); - b.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired(); - + b.Property(x => x.Type).HasMaxLength(ClientSecretConsts.TypeMaxLength).IsRequired(); if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { - SecretConsts.ValueMaxLength = 300; + ClientSecretConsts.ValueMaxLength = 300; } - - b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired(); - - b.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength); + b.Property(x => x.Value).HasMaxLength(ClientSecretConsts.ValueMaxLength).IsRequired(); + b.Property(x => x.Description).HasMaxLength(ClientSecretConsts.DescriptionMaxLength); }); builder.Entity(b => @@ -180,7 +178,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.ConfigureByConvention(); - b.HasKey(x => new {x.ClientId, x.Key}); + b.HasKey(x => new {x.ClientId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(ClientPropertyConsts.KeyMaxLength).IsRequired(); b.Property(x => x.Value).HasMaxLength(ClientPropertyConsts.ValueMaxLength).IsRequired(); @@ -223,7 +221,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.ConfigureByConvention(); - b.HasKey(x => new {x.IdentityResourceId, x.Key}); + b.HasKey(x => new {x.IdentityResourceId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(IdentityResourcePropertyConsts.KeyMaxLength).IsRequired(); if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) @@ -248,6 +246,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.Property(x => x.Name).HasMaxLength(ApiResourceConsts.NameMaxLength).IsRequired(); b.Property(x => x.DisplayName).HasMaxLength(ApiResourceConsts.DisplayNameMaxLength); b.Property(x => x.Description).HasMaxLength(ApiResourceConsts.DescriptionMaxLength); + b.Property(x => x.AllowedAccessTokenSigningAlgorithms).HasMaxLength(ApiResourceConsts.AllowedAccessTokenSigningAlgorithmsMaxLength); b.HasMany(x => x.Secrets).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); b.HasMany(x => x.Scopes).WithOne().HasForeignKey(x => x.ApiResourceId).IsRequired(); @@ -263,15 +262,15 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.HasKey(x => new {x.ApiResourceId, x.Type, x.Value}); - b.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired(); + b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired(); if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) { - SecretConsts.ValueMaxLength = 300; + ApiResourceSecretConsts.ValueMaxLength = 300; } - b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired(); + b.Property(x => x.Value).HasMaxLength(ApiResourceSecretConsts.ValueMaxLength).IsRequired(); - b.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength); + b.Property(x => x.Description).HasMaxLength(ApiResourceSecretConsts.DescriptionMaxLength); }); builder.Entity(b => @@ -302,7 +301,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.ConfigureByConvention(); - b.HasKey(x => new {x.ApiResourceId, x.Key}); + b.HasKey(x => new {x.ApiResourceId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(ApiResourcePropertyConsts.KeyMaxLength).IsRequired(); if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) @@ -349,7 +348,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore b.ConfigureByConvention(); - b.HasKey(x => new {x.ApiScopeId, x.Key}); + b.HasKey(x => new {x.ApiScopeId, x.Key, x.Value}); b.Property(x => x.Key).HasMaxLength(ApiScopePropertyConsts.KeyMaxLength).IsRequired(); if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707050900_Initial.Designer.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707075540_Initial.Designer.cs similarity index 99% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707050900_Initial.Designer.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707075540_Initial.Designer.cs index ee4de4f358..fadec16eaf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707050900_Initial.Designer.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707075540_Initial.Designer.cs @@ -11,7 +11,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(MyProjectNameMigrationsDbContext))] - [Migration("20200707050900_Initial")] + [Migration("20200707075540_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -873,11 +873,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ApiResourceId", "Key"); + b.HasKey("ApiResourceId", "Key", "Value"); b.ToTable("IdentityServerApiResourceProperties"); }); @@ -889,7 +888,8 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("uniqueidentifier"); b.Property("AllowedAccessTokenSigningAlgorithms") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); b.Property("ConcurrencyStamp") .IsConcurrencyToken() @@ -1114,11 +1114,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ApiScopeId", "Key"); + b.HasKey("ApiScopeId", "Key", "Value"); b.ToTable("IdentityServerApiScopeProperties"); }); @@ -1151,7 +1150,8 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("bit"); b.Property("AllowedIdentityTokenSigningAlgorithms") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("bit"); @@ -1390,11 +1390,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ClientId", "Key"); + b.HasKey("ClientId", "Key", "Value"); b.ToTable("IdentityServerClientProperties"); }); @@ -1441,8 +1440,8 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(4000); b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); b.Property("Expiration") .HasColumnType("datetime2"); @@ -1693,11 +1692,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("IdentityResourceId", "Key"); + b.HasKey("IdentityResourceId", "Key", "Value"); b.ToTable("IdentityServerIdentityResourceProperties"); }); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707050900_Initial.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707075540_Initial.cs similarity index 99% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707050900_Initial.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707075540_Initial.cs index 48726d777b..669982f451 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707050900_Initial.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200707075540_Initial.cs @@ -249,7 +249,7 @@ namespace MyCompanyName.MyProjectName.Migrations DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), Enabled = table.Column(nullable: false), - AllowedAccessTokenSigningAlgorithms = table.Column(nullable: true), + AllowedAccessTokenSigningAlgorithms = table.Column(maxLength: 100, nullable: true), ShowInDiscoveryDocument = table.Column(nullable: false) }, constraints: table => @@ -319,7 +319,7 @@ namespace MyCompanyName.MyProjectName.Migrations BackChannelLogoutSessionRequired = table.Column(nullable: false), AllowOfflineAccess = table.Column(nullable: false), IdentityTokenLifetime = table.Column(nullable: false), - AllowedIdentityTokenSigningAlgorithms = table.Column(nullable: true), + AllowedIdentityTokenSigningAlgorithms = table.Column(maxLength: 100, nullable: true), AccessTokenLifetime = table.Column(nullable: false), AuthorizationCodeLifetime = table.Column(nullable: false), ConsentLifetime = table.Column(nullable: true), @@ -676,7 +676,7 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key }); + table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResources_ApiResourceId", column: x => x.ApiResourceId, @@ -752,7 +752,7 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key }); + table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_ApiScopeId", column: x => x.ApiScopeId, @@ -862,7 +862,7 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", column: x => x.ClientId, @@ -914,7 +914,7 @@ namespace MyCompanyName.MyProjectName.Migrations Type = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 4000, nullable: false), ClientId = table.Column(nullable: false), - Description = table.Column(maxLength: 1000, nullable: true), + Description = table.Column(maxLength: 2000, nullable: true), Expiration = table.Column(nullable: true) }, constraints: table => @@ -956,7 +956,7 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key }); + table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdentityResources_IdentityResourceId", column: x => x.IdentityResourceId, diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs index bfcb19749d..e3bb89da7d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/MyProjectNameMigrationsDbContextModelSnapshot.cs @@ -871,11 +871,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ApiResourceId", "Key"); + b.HasKey("ApiResourceId", "Key", "Value"); b.ToTable("IdentityServerApiResourceProperties"); }); @@ -887,7 +886,8 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("uniqueidentifier"); b.Property("AllowedAccessTokenSigningAlgorithms") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); b.Property("ConcurrencyStamp") .IsConcurrencyToken() @@ -1112,11 +1112,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ApiScopeId", "Key"); + b.HasKey("ApiScopeId", "Key", "Value"); b.ToTable("IdentityServerApiScopeProperties"); }); @@ -1149,7 +1148,8 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("bit"); b.Property("AllowedIdentityTokenSigningAlgorithms") - .HasColumnType("nvarchar(max)"); + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("bit"); @@ -1388,11 +1388,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ClientId", "Key"); + b.HasKey("ClientId", "Key", "Value"); b.ToTable("IdentityServerClientProperties"); }); @@ -1439,8 +1438,8 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(4000); b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); b.Property("Expiration") .HasColumnType("datetime2"); @@ -1691,11 +1690,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("IdentityResourceId", "Key"); + b.HasKey("IdentityResourceId", "Key", "Value"); b.ToTable("IdentityServerIdentityResourceProperties"); }); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200624023331_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200707075532_Initial.Designer.cs similarity index 89% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200624023331_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200707075532_Initial.Designer.cs index 23c25b58cd..59e4e386ff 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200624023331_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200707075532_Initial.Designer.cs @@ -11,7 +11,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(IdentityServerHostMigrationsDbContext))] - [Migration("20200624023331_Initial")] + [Migration("20200707075532_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -774,12 +774,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpOrganizationUnitRoles"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") @@ -836,15 +858,18 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(200)") .HasMaxLength(200); - b.Property("Properties") - .HasColumnType("nvarchar(max)"); + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); b.HasKey("Id"); + b.HasIndex("Name") + .IsUnique(); + b.ToTable("IdentityServerApiResources"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b => { b.Property("ApiResourceId") .HasColumnType("uniqueidentifier"); @@ -855,18 +880,76 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasKey("ApiResourceId", "Type"); - b.ToTable("IdentityServerApiClaims"); + b.ToTable("IdentityServerApiResourceClaims"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b => { b.Property("ApiResourceId") .HasColumnType("uniqueidentifier"); - b.Property("Name") + b.Property("Scope") .HasColumnType("nvarchar(200)") .HasMaxLength(200); + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + b.Property("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); @@ -878,58 +961,76 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Emphasize") .HasColumnType("bit"); + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("Required") .HasColumnType("bit"); b.Property("ShowInDiscoveryDocument") .HasColumnType("bit"); - b.HasKey("ApiResourceId", "Name"); + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); b.ToTable("IdentityServerApiScopes"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => { - b.Property("ApiResourceId") + b.Property("ApiScopeId") .HasColumnType("uniqueidentifier"); - b.Property("Name") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - b.Property("Type") .HasColumnType("nvarchar(200)") .HasMaxLength(200); - b.HasKey("ApiResourceId", "Name", "Type"); + b.HasKey("ApiScopeId", "Type"); b.ToTable("IdentityServerApiScopeClaims"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => { - b.Property("ApiResourceId") + b.Property("ApiScopeId") .HasColumnType("uniqueidentifier"); - b.Property("Type") + b.Property("Key") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property("Value") - .HasColumnType("nvarchar(4000)") - .HasMaxLength(4000); - - b.Property("Description") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.Property("Expiration") - .HasColumnType("datetime2"); + b.HasKey("ApiScopeId", "Key", "Value"); - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); + b.ToTable("IdentityServerApiScopeProperties"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => @@ -959,6 +1060,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("AllowRememberConsent") .HasColumnType("bit"); + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("bit"); @@ -1089,6 +1194,9 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("RequirePkce") .HasColumnType("bit"); + b.Property("RequireRequestObject") + .HasColumnType("bit"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); @@ -1193,11 +1301,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ClientId", "Key"); + b.HasKey("ClientId", "Key", "Value"); b.ToTable("IdentityServerClientProperties"); }); @@ -1285,6 +1392,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(max)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("DeviceCode") .IsRequired() .HasColumnType("nvarchar(200)") @@ -1298,6 +1409,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); @@ -1314,8 +1429,7 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("Expiration"); - b.HasIndex("UserCode") - .IsUnique(); + b.HasIndex("UserCode"); b.ToTable("IdentityServerDeviceFlowCodes"); }); @@ -1337,6 +1451,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(40)") .HasMaxLength(40); + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + b.Property("CreationTime") .HasColumnType("datetime2"); @@ -1345,6 +1462,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(max)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("Expiration") .HasColumnType("datetime2"); @@ -1355,6 +1476,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); @@ -1370,21 +1495,9 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("SubjectId", "ClientId", "Type"); - b.ToTable("IdentityServerPersistedGrants"); - }); + b.HasIndex("SubjectId", "SessionId", "Type"); - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("IdentityResourceId", "Type"); - - b.ToTable("IdentityServerIdentityClaims"); + b.ToTable("IdentityServerPersistedGrants"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => @@ -1452,9 +1565,6 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(200)") .HasMaxLength(200); - b.Property("Properties") - .HasColumnType("nvarchar(max)"); - b.Property("Required") .HasColumnType("bit"); @@ -1463,9 +1573,44 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasKey("Id"); + b.HasIndex("Name") + .IsUnique(); + b.ToTable("IdentityServerIdentityResources"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties"); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1721,38 +1866,56 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") + .HasForeignKey("ApiScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); @@ -1838,7 +2001,7 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => { b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) .WithMany("UserClaims") @@ -1847,6 +2010,15 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired(); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { b.HasOne("Volo.Abp.TenantManagement.Tenant", null) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200624023331_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200707075532_Initial.cs similarity index 87% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200624023331_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200707075532_Initial.cs index 9287186f86..2ee3b628fb 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200624023331_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200707075532_Initial.cs @@ -213,13 +213,41 @@ namespace MyCompanyName.MyProjectName.Migrations DisplayName = table.Column(maxLength: 200, nullable: true), Description = table.Column(maxLength: 1000, nullable: true), Enabled = table.Column(nullable: false), - Properties = table.Column(nullable: true) + AllowedAccessTokenSigningAlgorithms = table.Column(maxLength: 100, nullable: true), + ShowInDiscoveryDocument = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); }); + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 40, nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + LastModificationTime = table.Column(nullable: true), + LastModifierId = table.Column(nullable: true), + IsDeleted = table.Column(nullable: false, defaultValue: false), + DeleterId = table.Column(nullable: true), + DeletionTime = table.Column(nullable: true), + Enabled = table.Column(nullable: false), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + Required = table.Column(nullable: false), + Emphasize = table.Column(nullable: false), + ShowInDiscoveryDocument = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id); + }); + migrationBuilder.CreateTable( name: "IdentityServerClients", columns: table => new @@ -247,6 +275,7 @@ namespace MyCompanyName.MyProjectName.Migrations AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), RequirePkce = table.Column(nullable: false), AllowPlainTextPkce = table.Column(nullable: false), + RequireRequestObject = table.Column(nullable: false), AllowAccessTokensViaBrowser = table.Column(nullable: false), FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), FrontChannelLogoutSessionRequired = table.Column(nullable: false), @@ -254,6 +283,7 @@ namespace MyCompanyName.MyProjectName.Migrations BackChannelLogoutSessionRequired = table.Column(nullable: false), AllowOfflineAccess = table.Column(nullable: false), IdentityTokenLifetime = table.Column(nullable: false), + AllowedIdentityTokenSigningAlgorithms = table.Column(maxLength: 100, nullable: true), AccessTokenLifetime = table.Column(nullable: false), AuthorizationCodeLifetime = table.Column(nullable: false), ConsentLifetime = table.Column(nullable: true), @@ -289,7 +319,9 @@ namespace MyCompanyName.MyProjectName.Migrations DeviceCode = table.Column(maxLength: 200, nullable: false), UserCode = table.Column(maxLength: 200, nullable: false), SubjectId = table.Column(maxLength: 200, nullable: true), + SessionId = table.Column(maxLength: 100, nullable: true), ClientId = table.Column(maxLength: 200, nullable: false), + Description = table.Column(maxLength: 200, nullable: true), Expiration = table.Column(nullable: false), Data = table.Column(maxLength: 50000, nullable: false) }, @@ -318,8 +350,7 @@ namespace MyCompanyName.MyProjectName.Migrations Enabled = table.Column(nullable: false), Required = table.Column(nullable: false), Emphasize = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false), - Properties = table.Column(nullable: true) + ShowInDiscoveryDocument = table.Column(nullable: false) }, constraints: table => { @@ -336,9 +367,12 @@ namespace MyCompanyName.MyProjectName.Migrations ConcurrencyStamp = table.Column(maxLength: 40, nullable: true), Type = table.Column(maxLength: 50, nullable: false), SubjectId = table.Column(maxLength: 200, nullable: true), + SessionId = table.Column(maxLength: 100, nullable: true), ClientId = table.Column(maxLength: 200, nullable: false), + Description = table.Column(maxLength: 200, nullable: true), CreationTime = table.Column(nullable: false), Expiration = table.Column(nullable: true), + ConsumedTime = table.Column(nullable: true), Data = table.Column(maxLength: 50000, nullable: false) }, constraints: table => @@ -579,7 +613,7 @@ namespace MyCompanyName.MyProjectName.Migrations }); migrationBuilder.CreateTable( - name: "IdentityServerApiClaims", + name: "IdentityServerApiResourceClaims", columns: table => new { Type = table.Column(maxLength: 200, nullable: false), @@ -587,9 +621,9 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); + table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type }); table.ForeignKey( - name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", + name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", @@ -597,22 +631,36 @@ namespace MyCompanyName.MyProjectName.Migrations }); migrationBuilder.CreateTable( - name: "IdentityServerApiScopes", + name: "IdentityServerApiResourceProperties", columns: table => new { ApiResourceId = table.Column(nullable: false), - Name = table.Column(maxLength: 200, nullable: false), - DisplayName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - Required = table.Column(nullable: false), - Emphasize = table.Column(nullable: false), - ShowInDiscoveryDocument = table.Column(nullable: false) + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResourceScopes", + columns: table => new + { + ApiResourceId = table.Column(nullable: false), + Scope = table.Column(maxLength: 200, nullable: false) }, constraints: table => { - table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); + table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); table.ForeignKey( - name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", + name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", @@ -620,26 +668,63 @@ namespace MyCompanyName.MyProjectName.Migrations }); migrationBuilder.CreateTable( - name: "IdentityServerApiSecrets", + name: "IdentityServerApiResourceSecrets", columns: table => new { Type = table.Column(maxLength: 250, nullable: false), Value = table.Column(maxLength: 4000, nullable: false), ApiResourceId = table.Column(nullable: false), - Description = table.Column(maxLength: 2000, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), Expiration = table.Column(nullable: true) }, constraints: table => { - table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); table.ForeignKey( - name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", + name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_ApiResourceId", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeClaims", + columns: table => new + { + Type = table.Column(maxLength: 200, nullable: false), + ApiScopeId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScopeId", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopeProperties", + columns: table => new + { + ApiScopeId = table.Column(nullable: false), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_ApiScopeId", + column: x => x.ApiScopeId, + principalTable: "IdentityServerApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "IdentityServerClientClaims", columns: table => new @@ -741,7 +826,7 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", column: x => x.ClientId, @@ -808,7 +893,7 @@ namespace MyCompanyName.MyProjectName.Migrations }); migrationBuilder.CreateTable( - name: "IdentityServerIdentityClaims", + name: "IdentityServerIdentityResourceClaims", columns: table => new { Type = table.Column(maxLength: 200, nullable: false), @@ -816,9 +901,28 @@ namespace MyCompanyName.MyProjectName.Migrations }, constraints: table => { - table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); + table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResourceProperties", + columns: table => new + { + IdentityResourceId = table.Column(nullable: false), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); table.ForeignKey( - name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", + name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdentityResources_IdentityResourceId", column: x => x.IdentityResourceId, principalTable: "IdentityServerIdentityResources", principalColumn: "Id", @@ -848,25 +952,6 @@ namespace MyCompanyName.MyProjectName.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "IdentityServerApiScopeClaims", - columns: table => new - { - Type = table.Column(maxLength: 200, nullable: false), - ApiResourceId = table.Column(nullable: false), - Name = table.Column(maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiResourceId, x.Name, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiResourceId_Name", - columns: x => new { x.ApiResourceId, x.Name }, - principalTable: "IdentityServerApiScopes", - principalColumns: new[] { "ApiResourceId", "Name" }, - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", @@ -982,6 +1067,18 @@ namespace MyCompanyName.MyProjectName.Migrations table: "AbpUsers", column: "UserName"); + migrationBuilder.CreateIndex( + name: "IX_IdentityServerApiResources_Name", + table: "IdentityServerApiResources", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerApiScopes_Name", + table: "IdentityServerApiScopes", + column: "Name", + unique: true); + migrationBuilder.CreateIndex( name: "IX_IdentityServerClients_ClientId", table: "IdentityServerClients", @@ -1001,7 +1098,12 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.CreateIndex( name: "IX_IdentityServerDeviceFlowCodes_UserCode", table: "IdentityServerDeviceFlowCodes", - column: "UserCode", + column: "UserCode"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerIdentityResources_Name", + table: "IdentityServerIdentityResources", + column: "Name", unique: true); migrationBuilder.CreateIndex( @@ -1013,6 +1115,11 @@ namespace MyCompanyName.MyProjectName.Migrations name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", table: "IdentityServerPersistedGrants", columns: new[] { "SubjectId", "ClientId", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); } protected override void Down(MigrationBuilder migrationBuilder) @@ -1057,13 +1164,22 @@ namespace MyCompanyName.MyProjectName.Migrations name: "AbpUserTokens"); migrationBuilder.DropTable( - name: "IdentityServerApiClaims"); + name: "IdentityServerApiResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResourceSecrets"); migrationBuilder.DropTable( name: "IdentityServerApiScopeClaims"); migrationBuilder.DropTable( - name: "IdentityServerApiSecrets"); + name: "IdentityServerApiScopeProperties"); migrationBuilder.DropTable( name: "IdentityServerClientClaims"); @@ -1096,7 +1212,10 @@ namespace MyCompanyName.MyProjectName.Migrations name: "IdentityServerDeviceFlowCodes"); migrationBuilder.DropTable( - name: "IdentityServerIdentityClaims"); + name: "IdentityServerIdentityResourceClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResourceProperties"); migrationBuilder.DropTable( name: "IdentityServerPersistedGrants"); @@ -1116,6 +1235,9 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpUsers"); + migrationBuilder.DropTable( + name: "IdentityServerApiResources"); + migrationBuilder.DropTable( name: "IdentityServerApiScopes"); @@ -1127,9 +1249,6 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.DropTable( name: "AbpAuditLogs"); - - migrationBuilder.DropTable( - name: "IdentityServerApiResources"); } } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs index 44c00e04d4..c2aac52e7c 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs @@ -772,12 +772,34 @@ namespace MyCompanyName.MyProjectName.Migrations b.ToTable("AbpOrganizationUnitRoles"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResource", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") @@ -834,15 +856,18 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(200)") .HasMaxLength(200); - b.Property("Properties") - .HasColumnType("nvarchar(max)"); + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); b.HasKey("Id"); + b.HasIndex("Name") + .IsUnique(); + b.ToTable("IdentityServerApiResources"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b => { b.Property("ApiResourceId") .HasColumnType("uniqueidentifier"); @@ -853,18 +878,76 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasKey("ApiResourceId", "Type"); - b.ToTable("IdentityServerApiClaims"); + b.ToTable("IdentityServerApiResourceClaims"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b => { b.Property("ApiResourceId") .HasColumnType("uniqueidentifier"); - b.Property("Name") + b.Property("Scope") .HasColumnType("nvarchar(200)") .HasMaxLength(200); + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + b.Property("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); @@ -876,58 +959,76 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Emphasize") .HasColumnType("bit"); + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("Required") .HasColumnType("bit"); b.Property("ShowInDiscoveryDocument") .HasColumnType("bit"); - b.HasKey("ApiResourceId", "Name"); + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); b.ToTable("IdentityServerApiScopes"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => { - b.Property("ApiResourceId") + b.Property("ApiScopeId") .HasColumnType("uniqueidentifier"); - b.Property("Name") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - b.Property("Type") .HasColumnType("nvarchar(200)") .HasMaxLength(200); - b.HasKey("ApiResourceId", "Name", "Type"); + b.HasKey("ApiScopeId", "Type"); b.ToTable("IdentityServerApiScopeClaims"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => { - b.Property("ApiResourceId") + b.Property("ApiScopeId") .HasColumnType("uniqueidentifier"); - b.Property("Type") + b.Property("Key") .HasColumnType("nvarchar(250)") .HasMaxLength(250); b.Property("Value") - .HasColumnType("nvarchar(4000)") - .HasMaxLength(4000); - - b.Property("Description") .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.Property("Expiration") - .HasColumnType("datetime2"); + b.HasKey("ApiScopeId", "Key", "Value"); - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); + b.ToTable("IdentityServerApiScopeProperties"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => @@ -957,6 +1058,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("AllowRememberConsent") .HasColumnType("bit"); + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("bit"); @@ -1087,6 +1192,9 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("RequirePkce") .HasColumnType("bit"); + b.Property("RequireRequestObject") + .HasColumnType("bit"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); @@ -1191,11 +1299,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasMaxLength(250); b.Property("Value") - .IsRequired() .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); - b.HasKey("ClientId", "Key"); + b.HasKey("ClientId", "Key", "Value"); b.ToTable("IdentityServerClientProperties"); }); @@ -1283,6 +1390,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(max)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("DeviceCode") .IsRequired() .HasColumnType("nvarchar(200)") @@ -1296,6 +1407,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); @@ -1312,8 +1427,7 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("Expiration"); - b.HasIndex("UserCode") - .IsUnique(); + b.HasIndex("UserCode"); b.ToTable("IdentityServerDeviceFlowCodes"); }); @@ -1335,6 +1449,9 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(40)") .HasMaxLength(40); + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + b.Property("CreationTime") .HasColumnType("datetime2"); @@ -1343,6 +1460,10 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(max)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("Expiration") .HasColumnType("datetime2"); @@ -1353,6 +1474,10 @@ namespace MyCompanyName.MyProjectName.Migrations b.Property("Id") .HasColumnType("uniqueidentifier"); + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); @@ -1368,21 +1493,9 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasIndex("SubjectId", "ClientId", "Type"); - b.ToTable("IdentityServerPersistedGrants"); - }); + b.HasIndex("SubjectId", "SessionId", "Type"); - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.Property("IdentityResourceId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("IdentityResourceId", "Type"); - - b.ToTable("IdentityServerIdentityClaims"); + b.ToTable("IdentityServerPersistedGrants"); }); modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => @@ -1450,9 +1563,6 @@ namespace MyCompanyName.MyProjectName.Migrations .HasColumnType("nvarchar(200)") .HasMaxLength(200); - b.Property("Properties") - .HasColumnType("nvarchar(max)"); - b.Property("Required") .HasColumnType("bit"); @@ -1461,9 +1571,44 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasKey("Id"); + b.HasIndex("Name") + .IsUnique(); + b.ToTable("IdentityServerIdentityResources"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties"); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -1719,38 +1864,56 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) .WithMany("UserClaims") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceScope", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) .WithMany("Scopes") .HasForeignKey("ApiResourceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") + .HasForeignKey("ApiScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); @@ -1836,7 +1999,7 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => { b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) .WithMany("UserClaims") @@ -1845,6 +2008,15 @@ namespace MyCompanyName.MyProjectName.Migrations .IsRequired(); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { b.HasOne("Volo.Abp.TenantManagement.Tenant", null) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200624023340_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200707075539_Initial.Designer.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200624023340_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200707075539_Initial.Designer.cs index d93e2804a6..ee1b9c6c25 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200624023340_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200707075539_Initial.Designer.cs @@ -11,7 +11,7 @@ using Volo.Abp.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20200624023340_Initial")] + [Migration("20200707075539_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200624023340_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200707075539_Initial.cs similarity index 100% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200624023340_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200707075539_Initial.cs