From 0d10a61b7b20fe6d6f30dae6383ac1f701ee2807 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 6 Jan 2020 16:38:53 +0800 Subject: [PATCH] Re-generate EF Core migrations for the startup templates. Resolve #2547 --- .../BookStoreDomainSharedModule.cs | 2 +- .../BookStoreTestBase.cs | 42 +- .../BookStoreDomainSharedModule.cs | 2 +- ....cs => 20200106083302_Initial.Designer.cs} | 125 +- .../Migrations/20200106083302_Initial.cs} | 48 +- ...200106083327_Added_Book_Entity.Designer.cs | 1811 +++++++++++++++++ ...cs => 20200106083327_Added_Book_Entity.cs} | 0 ...okStoreMigrationsDbContextModelSnapshot.cs | 71 +- .../BookStoreTestBase.cs | 40 - .../BookStoreWebTestModule.cs | 2 +- .../20191018081038_Initial.Designer.cs | 1610 --------------- .../Migrations/20191018081038_Initial.cs | 982 --------- .../20200106082830_Initial.Designer.cs} | 165 +- .../Migrations/20200106082830_Initial.cs | 1022 ++++++++++ ...verHostMigrationsDbContextModelSnapshot.cs | 71 +- .../20190527144415_Initial.Designer.cs | 716 ------- .../20200106082340_Initial.Designer.cs} | 844 ++------ ...5_Initial.cs => 20200106082340_Initial.cs} | 31 +- .../UnifiedDbContextModelSnapshot.cs | 398 +++- ...kStore.BookManagement.Domain.Shared.csproj | 2 +- .../BookManagementDomainSharedModule.cs | 2 +- .../BookManagementTestBase.cs | 40 - .../BookStoreDomainSharedModule.cs | 2 +- ....cs => 20200106080124_Initial.Designer.cs} | 125 +- .../Migrations/20200106080124_Initial.cs} | 48 +- ...0106080206_Created_Book_Entity.Designer.cs | 1811 +++++++++++++++++ ... => 20200106080206_Created_Book_Entity.cs} | 0 ...okStoreMigrationsDbContextModelSnapshot.cs | 71 +- .../BookStoreTestBase.cs | 40 - .../BookStoreWebTestModule.cs | 2 +- .../DashboardDemoDomainSharedModule.cs | 2 +- ....cs => 20200106080501_Initial.Designer.cs} | 73 +- ...4_Initial.cs => 20200106080501_Initial.cs} | 48 +- ...ardDemoMigrationsDbContextModelSnapshot.cs | 71 +- .../DashboardDemoTestBase.cs | 40 - .../DashboardDemoWebTestModule.cs | 2 +- .../Migrations/20191018081320_Initial.cs | 930 --------- .../20200106080946_Initial.Designer.cs | 161 +- .../Migrations/20200106080946_Initial.cs | 98 +- .../AuthServerDbContextModelSnapshot.cs | 68 +- .../ProductManagementWebModule.cs | 2 +- .../ProductManagementDomainTestBase.cs | 40 - .../20200106080719_Initial.Designer.cs | 79 +- ...7_Initial.cs => 20200106080719_Initial.cs} | 41 + ...ectNameMigrationsDbContextModelSnapshot.cs | 64 + .../20200106080828_Initial.Designer.cs} | 154 +- .../Migrations/20200106080828_Initial.cs | 1022 ++++++++++ ...verHostMigrationsDbContextModelSnapshot.cs | 68 +- ....cs => 20200106080643_Initial.Designer.cs} | 2 +- ...7_Initial.cs => 20200106080643_Initial.cs} | 0 50 files changed, 7297 insertions(+), 5793 deletions(-) rename samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/{20191018081734_Added_Book_Entity.Designer.cs => 20200106083302_Initial.Designer.cs} (97%) rename samples/{BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.cs => BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.cs} (96%) create mode 100644 samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083327_Added_Book_Entity.Designer.cs rename samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/{20191018081734_Added_Book_Entity.cs => 20200106083327_Added_Book_Entity.cs} (100%) delete mode 100644 samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.Designer.cs delete mode 100644 samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.cs rename samples/BookStore-Modular/{application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.Designer.cs => modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.Designer.cs} (96%) create mode 100644 samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.cs delete mode 100644 samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.Designer.cs rename samples/{MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.Designer.cs => BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.Designer.cs} (56%) rename samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/{20190527144415_Initial.cs => 20200106082340_Initial.cs} (95%) rename samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/{20191018080014_Created_Book_Entity.Designer.cs => 20200106080124_Initial.Designer.cs} (97%) rename samples/{BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.cs => BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.cs} (96%) create mode 100644 samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080206_Created_Book_Entity.Designer.cs rename samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/{20191018080014_Created_Book_Entity.cs => 20200106080206_Created_Book_Entity.cs} (100%) rename samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/{20191018081444_Initial.Designer.cs => 20200106080501_Initial.Designer.cs} (96%) rename samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/{20191018081444_Initial.cs => 20200106080501_Initial.cs} (96%) delete mode 100644 samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.cs rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs => samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.Designer.cs (96%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs => samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.cs (96%) rename samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.Designer.cs => templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.Designer.cs (96%) rename templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/{20191218090017_Initial.cs => 20200106080719_Initial.cs} (96%) rename templates/{app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.Designer.cs => module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.Designer.cs} (96%) create mode 100644 templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.cs rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/{20191218090727_Initial.Designer.cs => 20200106080643_Initial.Designer.cs} (99%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/{20191218090727_Initial.cs => 20200106080643_Initial.cs} (100%) diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs index 95241feeb8c..6ac58cef9ee 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs @@ -5,7 +5,7 @@ using Volo.Abp.Identity; using Volo.Abp.IdentityServer; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; using Volo.Abp.SettingManagement; diff --git a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/BookStoreTestBase.cs b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/BookStoreTestBase.cs index 0f44532e7a7..9bf254bf5b5 100644 --- a/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/BookStoreTestBase.cs +++ b/samples/BookStore-Angular-MongoDb/aspnet-core/test/Acme.BookStore.TestBase/BookStoreTestBase.cs @@ -18,26 +18,6 @@ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationO options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -57,27 +37,7 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F } } } - - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - + protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs index 8d6172ee284..188a73118fa 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs @@ -6,7 +6,7 @@ using Volo.Abp.Identity; using Volo.Abp.IdentityServer; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; using Volo.Abp.SettingManagement; diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081734_Added_Book_Entity.Designer.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.Designer.cs similarity index 97% rename from samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081734_Added_Book_Entity.Designer.cs rename to samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.Designer.cs index 105259f357d..f1c515923e9 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081734_Added_Book_Entity.Designer.cs +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.Designer.cs @@ -10,67 +10,17 @@ namespace Acme.BookStore.Migrations { [DbContext(typeof(BookStoreMigrationsDbContext))] - [Migration("20191018081734_Added_Book_Entity")] - partial class Added_Book_Entity + [Migration("20200106083302_Initial")] + partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("Acme.BookStore.BookManagement.Books.Book", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime2"); - - b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("uniqueidentifier"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime2"); - - b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Price") - .HasColumnType("real"); - - b.Property("PublishDate") - .HasColumnType("datetime2"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BmBooks"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property("Id") @@ -562,6 +512,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -605,6 +556,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1247,6 +1199,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1503,8 +1519,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.cs similarity index 96% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.cs rename to samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.cs index cc04cddbf27..de6dd334dd6 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.cs +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083302_Initial.cs @@ -184,8 +184,8 @@ protected override void Up(MigrationBuilder migrationBuilder) NormalizedUserName = table.Column(maxLength: 256, nullable: false), Name = table.Column(maxLength: 64, nullable: true), Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), EmailConfirmed = table.Column(nullable: false, defaultValue: false), PasswordHash = table.Column(maxLength: 256, nullable: true), SecurityStamp = table.Column(maxLength: 256, nullable: false), @@ -283,6 +283,27 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_IdentityServerClients", x => x.Id); }); + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + migrationBuilder.CreateTable( name: "IdentityServerIdentityResources", columns: table => new @@ -866,8 +887,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_AbpTenants_Name", table: "AbpTenants", - column: "Name", - unique: true); + column: "Name"); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", @@ -909,6 +929,23 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "IdentityServerClients", column: "ClientId"); + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_Expiration", table: "IdentityServerPersistedGrants", @@ -997,6 +1034,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "IdentityServerClientSecrets"); + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + migrationBuilder.DropTable( name: "IdentityServerIdentityClaims"); diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083327_Added_Book_Entity.Designer.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083327_Added_Book_Entity.Designer.cs new file mode 100644 index 00000000000..fd3a713e5db --- /dev/null +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083327_Added_Book_Entity.Designer.cs @@ -0,0 +1,1811 @@ +// +using System; +using Acme.BookStore.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Acme.BookStore.Migrations +{ + [DbContext(typeof(BookStoreMigrationsDbContext))] + [Migration("20200106083327_Added_Book_Entity")] + partial class Added_Book_Entity + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Acme.BookStore.BookManagement.Books.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Price") + .HasColumnType("real"); + + b.Property("PublishDate") + .HasColumnType("datetime2"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("BmBooks"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + 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("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + 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("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", 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(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + 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); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + 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("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .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("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + 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"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + 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("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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("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(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081734_Added_Book_Entity.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083327_Added_Book_Entity.cs similarity index 100% rename from samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081734_Added_Book_Entity.cs rename to samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106083327_Added_Book_Entity.cs diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs index 0577f0d3998..4848f244de1 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs +++ b/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -560,6 +560,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -603,6 +604,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1245,6 +1247,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1501,8 +1567,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/BookStoreTestBase.cs b/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/BookStoreTestBase.cs index 0f44532e7a7..979c344f933 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/BookStoreTestBase.cs +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.TestBase/BookStoreTestBase.cs @@ -18,26 +18,6 @@ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationO options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -58,26 +38,6 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs b/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs index b9d79b1baae..d92f3bbfcf5 100644 --- a/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs +++ b/samples/BookStore-Modular/application/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs @@ -12,7 +12,7 @@ using Volo.Abp; using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.Designer.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.Designer.cs deleted file mode 100644 index 0e8868dd776..00000000000 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.Designer.cs +++ /dev/null @@ -1,1610 +0,0 @@ -// -using System; -using Acme.BookStore.BookManagement.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Acme.BookStore.BookManagement.Migrations -{ - [DbContext(typeof(IdentityServerHostMigrationsDbContext))] - [Migration("20191018081038_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ApplicationName") - .HasColumnName("ApplicationName") - .HasColumnType("nvarchar(96)") - .HasMaxLength(96); - - b.Property("BrowserInfo") - .HasColumnName("BrowserInfo") - .HasColumnType("nvarchar(512)") - .HasMaxLength(512); - - b.Property("ClientId") - .HasColumnName("ClientId") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ClientIpAddress") - .HasColumnName("ClientIpAddress") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ClientName") - .HasColumnName("ClientName") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Comments") - .HasColumnName("Comments") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CorrelationId") - .HasColumnName("CorrelationId") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Exceptions") - .HasColumnName("Exceptions") - .HasColumnType("nvarchar(4000)") - .HasMaxLength(4000); - - b.Property("ExecutionDuration") - .HasColumnName("ExecutionDuration") - .HasColumnType("int"); - - b.Property("ExecutionTime") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("HttpMethod") - .HasColumnName("HttpMethod") - .HasColumnType("nvarchar(16)") - .HasMaxLength(16); - - b.Property("HttpStatusCode") - .HasColumnName("HttpStatusCode") - .HasColumnType("int"); - - b.Property("ImpersonatorTenantId") - .HasColumnName("ImpersonatorTenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("ImpersonatorUserId") - .HasColumnName("ImpersonatorUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantName") - .HasColumnType("nvarchar(max)"); - - b.Property("Url") - .HasColumnName("Url") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("UserId") - .HasColumnName("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("UserName") - .HasColumnName("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "ExecutionTime"); - - b.HasIndex("TenantId", "UserId", "ExecutionTime"); - - b.ToTable("AbpAuditLogs"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AuditLogId") - .HasColumnName("AuditLogId") - .HasColumnType("uniqueidentifier"); - - b.Property("ExecutionDuration") - .HasColumnName("ExecutionDuration") - .HasColumnType("int"); - - b.Property("ExecutionTime") - .HasColumnName("ExecutionTime") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("MethodName") - .HasColumnName("MethodName") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Parameters") - .HasColumnName("Parameters") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ServiceName") - .HasColumnName("ServiceName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AuditLogId"); - - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); - - b.ToTable("AbpAuditLogActions"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AuditLogId") - .HasColumnName("AuditLogId") - .HasColumnType("uniqueidentifier"); - - b.Property("ChangeTime") - .HasColumnName("ChangeTime") - .HasColumnType("datetime2"); - - b.Property("ChangeType") - .HasColumnName("ChangeType") - .HasColumnType("tinyint"); - - b.Property("EntityId") - .IsRequired() - .HasColumnName("EntityId") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("EntityTenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("EntityTypeFullName") - .IsRequired() - .HasColumnName("EntityTypeFullName") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("AuditLogId"); - - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); - - b.ToTable("AbpEntityChanges"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("EntityChangeId") - .HasColumnType("uniqueidentifier"); - - b.Property("NewValue") - .HasColumnName("NewValue") - .HasColumnType("nvarchar(512)") - .HasMaxLength(512); - - b.Property("OriginalValue") - .HasColumnName("OriginalValue") - .HasColumnType("nvarchar(512)") - .HasMaxLength(512); - - b.Property("PropertyName") - .IsRequired() - .HasColumnName("PropertyName") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("PropertyTypeFullName") - .IsRequired() - .HasColumnName("PropertyTypeFullName") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("EntityChangeId"); - - b.ToTable("AbpEntityPropertyChanges"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("Description") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("IsStatic") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("Regex") - .HasColumnType("nvarchar(512)") - .HasMaxLength(512); - - b.Property("RegexDescription") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Required") - .HasColumnType("bit"); - - b.Property("ValueType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AbpClaimTypes"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDefault") - .HasColumnName("IsDefault") - .HasColumnType("bit"); - - b.Property("IsPublic") - .HasColumnName("IsPublic") - .HasColumnType("bit"); - - b.Property("IsStatic") - .HasColumnName("IsStatic") - .HasColumnType("bit"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("AbpRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(1024)") - .HasMaxLength(1024); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AbpRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasColumnName("AccessFailedCount") - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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("Email") - .HasColumnName("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("EmailConfirmed") - .HasColumnType("bit") - .HasDefaultValue(false); - - 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("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasColumnName("LockoutEnabled") - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("Name") - .HasColumnName("Name") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("NormalizedEmail") - .HasColumnName("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasColumnName("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnName("PasswordHash") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasColumnName("PhoneNumber") - .HasColumnType("nvarchar(16)") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("PhoneNumberConfirmed") - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasColumnName("SecurityStamp") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("Surname") - .HasColumnName("Surname") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasColumnName("TwoFactorEnabled") - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasColumnName("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("Email"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.HasIndex("UserName"); - - b.ToTable("AbpUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(1024)") - .HasMaxLength(1024); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AbpUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasColumnType("nvarchar(196)") - .HasMaxLength(196); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("AbpUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("AbpUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AbpUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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); - - b.Property("DisplayName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - 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("Properties") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("ApiResourceId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ApiResourceId", "Type"); - - b.ToTable("IdentityServerApiClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("ApiResourceId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Emphasize") - .HasColumnType("bit"); - - b.Property("Required") - .HasColumnType("bit"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("bit"); - - b.HasKey("ApiResourceId", "Name"); - - b.ToTable("IdentityServerApiScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.Property("ApiResourceId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Type") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ApiResourceId", "Name", "Type"); - - b.ToTable("IdentityServerApiScopeClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", 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(2000)") - .HasMaxLength(2000); - - b.Property("Expiration") - .HasColumnType("datetime2"); - - b.HasKey("ApiResourceId", "Type", "Value"); - - b.ToTable("IdentityServerApiSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AbsoluteRefreshTokenLifetime") - .HasColumnType("int"); - - b.Property("AccessTokenLifetime") - .HasColumnType("int"); - - b.Property("AccessTokenType") - .HasColumnType("int"); - - b.Property("AllowAccessTokensViaBrowser") - .HasColumnType("bit"); - - b.Property("AllowOfflineAccess") - .HasColumnType("bit"); - - b.Property("AllowPlainTextPkce") - .HasColumnType("bit"); - - b.Property("AllowRememberConsent") - .HasColumnType("bit"); - - b.Property("AlwaysIncludeUserClaimsInIdToken") - .HasColumnType("bit"); - - b.Property("AlwaysSendClientClaims") - .HasColumnType("bit"); - - b.Property("AuthorizationCodeLifetime") - .HasColumnType("int"); - - b.Property("BackChannelLogoutSessionRequired") - .HasColumnType("bit"); - - b.Property("BackChannelLogoutUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("ConsentLifetime") - .HasColumnType("int"); - - 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); - - b.Property("DeviceCodeLifetime") - .HasColumnType("int"); - - b.Property("EnableLocalLogin") - .HasColumnType("bit"); - - b.Property("Enabled") - .HasColumnType("bit"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("FrontChannelLogoutSessionRequired") - .HasColumnType("bit"); - - b.Property("FrontChannelLogoutUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime") - .HasColumnType("int"); - - b.Property("IncludeJwtId") - .HasColumnType("bit"); - - 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("LogoUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ProtocolType") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration") - .HasColumnType("int"); - - b.Property("RefreshTokenUsage") - .HasColumnType("int"); - - b.Property("RequireClientSecret") - .HasColumnType("bit"); - - b.Property("RequireConsent") - .HasColumnType("bit"); - - b.Property("RequirePkce") - .HasColumnType("bit"); - - b.Property("SlidingRefreshTokenLifetime") - .HasColumnType("int"); - - b.Property("UpdateAccessTokenClaimsOnRefresh") - .HasColumnType("bit"); - - b.Property("UserCodeType") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("UserSsoLifetime") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("IdentityServerClients"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("Value") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientClaims"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Origin") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.HasKey("ClientId", "Origin"); - - b.ToTable("IdentityServerClientCorsOrigins"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("GrantType") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("IdentityServerClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Provider") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ClientId", "Provider"); - - b.ToTable("IdentityServerClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("PostLogoutRedirectUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.HasKey("ClientId", "PostLogoutRedirectUri"); - - b.ToTable("IdentityServerClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Key") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.HasKey("ClientId", "Key"); - - b.ToTable("IdentityServerClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("RedirectUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.HasKey("ClientId", "RedirectUri"); - - b.ToTable("IdentityServerClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Scope") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ClientId", "Scope"); - - b.ToTable("IdentityServerClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .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("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Data") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(50000); - - b.Property("Expiration") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("SubjectId") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("Expiration"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("IdentityServerPersistedGrants"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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); - - b.Property("DisplayName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - 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("Properties") - .HasColumnType("nvarchar(max)"); - - b.Property("Required") - .HasColumnType("bit"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderName") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(2048)") - .HasMaxLength(2048); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpSettings"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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("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(64)") - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpTenants"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(1024)") - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("AbpTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("Actions") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) - .WithMany("PropertyChanges") - .HasForeignKey("EntityChangeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser", null) - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.TenantManagement.Tenant", null) - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.cs deleted file mode 100644 index 5fea6094711..00000000000 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20191018081038_Initial.cs +++ /dev/null @@ -1,982 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Acme.BookStore.BookManagement.Migrations -{ - public partial class Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AbpAuditLogs", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - ApplicationName = table.Column(maxLength: 96, nullable: true), - UserId = table.Column(nullable: true), - UserName = table.Column(maxLength: 256, nullable: true), - TenantId = table.Column(nullable: true), - TenantName = table.Column(nullable: true), - ImpersonatorUserId = table.Column(nullable: true), - ImpersonatorTenantId = table.Column(nullable: true), - ExecutionTime = table.Column(nullable: false), - ExecutionDuration = table.Column(nullable: false), - ClientIpAddress = table.Column(maxLength: 64, nullable: true), - ClientName = table.Column(maxLength: 128, nullable: true), - ClientId = table.Column(maxLength: 64, nullable: true), - CorrelationId = table.Column(maxLength: 64, nullable: true), - BrowserInfo = table.Column(maxLength: 512, nullable: true), - HttpMethod = table.Column(maxLength: 16, nullable: true), - Url = table.Column(maxLength: 256, nullable: true), - Exceptions = table.Column(maxLength: 4000, nullable: true), - Comments = table.Column(maxLength: 256, nullable: true), - HttpStatusCode = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpClaimTypes", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), - Name = table.Column(maxLength: 256, nullable: false), - Required = table.Column(nullable: false), - IsStatic = table.Column(nullable: false), - Regex = table.Column(maxLength: 512, nullable: true), - RegexDescription = table.Column(maxLength: 128, nullable: true), - Description = table.Column(maxLength: 256, nullable: true), - ValueType = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpPermissionGrants", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - Name = table.Column(maxLength: 128, nullable: false), - ProviderName = table.Column(maxLength: 64, nullable: false), - ProviderKey = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpRoles", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), - TenantId = table.Column(nullable: true), - Name = table.Column(maxLength: 256, nullable: false), - NormalizedName = table.Column(maxLength: 256, nullable: false), - IsDefault = table.Column(nullable: false), - IsStatic = table.Column(nullable: false), - IsPublic = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpSettings", - columns: table => new - { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - Value = table.Column(maxLength: 2048, nullable: false), - ProviderName = table.Column(maxLength: 64, nullable: true), - ProviderKey = table.Column(maxLength: 64, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpSettings", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpTenants", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - Name = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpTenants", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpUsers", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - TenantId = table.Column(nullable: true), - UserName = table.Column(maxLength: 256, nullable: false), - NormalizedUserName = table.Column(maxLength: 256, nullable: false), - Name = table.Column(maxLength: 64, nullable: true), - Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false, defaultValue: false), - PasswordHash = table.Column(maxLength: 256, nullable: true), - SecurityStamp = table.Column(maxLength: 256, nullable: false), - PhoneNumber = table.Column(maxLength: 16, nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), - TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), - LockoutEnd = table.Column(nullable: true), - LockoutEnabled = table.Column(nullable: false, defaultValue: false), - AccessFailedCount = table.Column(nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiResources", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - Name = table.Column(maxLength: 200, nullable: false), - DisplayName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - Enabled = table.Column(nullable: false), - Properties = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClients", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - ClientId = table.Column(maxLength: 200, nullable: false), - ClientName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - ClientUri = table.Column(maxLength: 2000, nullable: true), - LogoUri = table.Column(maxLength: 2000, nullable: true), - Enabled = table.Column(nullable: false), - ProtocolType = table.Column(maxLength: 200, nullable: false), - RequireClientSecret = table.Column(nullable: false), - RequireConsent = table.Column(nullable: false), - AllowRememberConsent = table.Column(nullable: false), - AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), - RequirePkce = table.Column(nullable: false), - AllowPlainTextPkce = table.Column(nullable: false), - AllowAccessTokensViaBrowser = table.Column(nullable: false), - FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), - FrontChannelLogoutSessionRequired = table.Column(nullable: false), - BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), - BackChannelLogoutSessionRequired = table.Column(nullable: false), - AllowOfflineAccess = table.Column(nullable: false), - IdentityTokenLifetime = table.Column(nullable: false), - AccessTokenLifetime = table.Column(nullable: false), - AuthorizationCodeLifetime = table.Column(nullable: false), - ConsentLifetime = table.Column(nullable: true), - AbsoluteRefreshTokenLifetime = table.Column(nullable: false), - SlidingRefreshTokenLifetime = table.Column(nullable: false), - RefreshTokenUsage = table.Column(nullable: false), - UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false), - RefreshTokenExpiration = table.Column(nullable: false), - AccessTokenType = table.Column(nullable: false), - EnableLocalLogin = table.Column(nullable: false), - IncludeJwtId = table.Column(nullable: false), - AlwaysSendClientClaims = table.Column(nullable: false), - ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), - UserSsoLifetime = table.Column(nullable: true), - UserCodeType = table.Column(maxLength: 100, nullable: true), - DeviceCodeLifetime = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerIdentityResources", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - Name = table.Column(maxLength: 200, nullable: false), - DisplayName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - 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) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerPersistedGrants", - columns: table => new - { - Key = table.Column(maxLength: 200, nullable: false), - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - Type = table.Column(maxLength: 50, nullable: false), - SubjectId = table.Column(maxLength: 200, nullable: true), - ClientId = table.Column(maxLength: 200, nullable: false), - CreationTime = table.Column(nullable: false), - Expiration = table.Column(nullable: true), - Data = table.Column(maxLength: 50000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); - }); - - migrationBuilder.CreateTable( - name: "AbpAuditLogActions", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - AuditLogId = table.Column(nullable: false), - ServiceName = table.Column(maxLength: 256, nullable: true), - MethodName = table.Column(maxLength: 128, nullable: true), - Parameters = table.Column(maxLength: 2000, nullable: true), - ExecutionTime = table.Column(nullable: false), - ExecutionDuration = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); - table.ForeignKey( - name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", - column: x => x.AuditLogId, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpEntityChanges", - columns: table => new - { - Id = table.Column(nullable: false), - AuditLogId = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - ChangeTime = table.Column(nullable: false), - ChangeType = table.Column(nullable: false), - EntityTenantId = table.Column(nullable: true), - EntityId = table.Column(maxLength: 128, nullable: false), - EntityTypeFullName = table.Column(maxLength: 128, nullable: false), - ExtraProperties = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); - table.ForeignKey( - name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", - column: x => x.AuditLogId, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpRoleClaims_AbpRoles_RoleId", - column: x => x.RoleId, - principalTable: "AbpRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpTenantConnectionStrings", - columns: table => new - { - TenantId = table.Column(nullable: false), - Name = table.Column(maxLength: 64, nullable: false), - Value = table.Column(maxLength: 1024, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); - table.ForeignKey( - name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", - column: x => x.TenantId, - principalTable: "AbpTenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserClaims", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpUserClaims_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserLogins", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - TenantId = table.Column(nullable: true), - ProviderKey = table.Column(maxLength: 196, nullable: false), - ProviderDisplayName = table.Column(maxLength: 128, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); - table.ForeignKey( - name: "FK_AbpUserLogins_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserRoles", - columns: table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AbpUserRoles_AbpRoles_RoleId", - column: x => x.RoleId, - principalTable: "AbpRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AbpUserRoles_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserTokens", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - TenantId = table.Column(nullable: true), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AbpUserTokens_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiClaims", - columns: table => new - { - Type = table.Column(maxLength: 200, nullable: false), - ApiResourceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiScopes", - 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) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); - table.ForeignKey( - name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiSecrets", - 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), - Expiration = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientClaims", - columns: table => new - { - ClientId = table.Column(nullable: false), - Type = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientCorsOrigins", - columns: table => new - { - ClientId = table.Column(nullable: false), - Origin = table.Column(maxLength: 150, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); - table.ForeignKey( - name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientGrantTypes", - columns: table => new - { - ClientId = table.Column(nullable: false), - GrantType = table.Column(maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); - table.ForeignKey( - name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientIdPRestrictions", - columns: table => new - { - ClientId = table.Column(nullable: false), - Provider = table.Column(maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); - table.ForeignKey( - name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientPostLogoutRedirectUris", - columns: table => new - { - ClientId = table.Column(nullable: false), - PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); - table.ForeignKey( - name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientProperties", - columns: table => new - { - ClientId = table.Column(nullable: false), - Key = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); - table.ForeignKey( - name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientRedirectUris", - columns: table => new - { - ClientId = table.Column(nullable: false), - RedirectUri = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); - table.ForeignKey( - name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientScopes", - columns: table => new - { - ClientId = table.Column(nullable: false), - Scope = table.Column(maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); - table.ForeignKey( - name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientSecrets", - columns: table => new - { - Type = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 4000, nullable: false), - ClientId = table.Column(nullable: false), - Description = table.Column(maxLength: 2000, nullable: true), - Expiration = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerIdentityClaims", - columns: table => new - { - Type = table.Column(maxLength: 200, nullable: false), - IdentityResourceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", - column: x => x.IdentityResourceId, - principalTable: "IdentityServerIdentityResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpEntityPropertyChanges", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - EntityChangeId = table.Column(nullable: false), - NewValue = table.Column(maxLength: 512, nullable: true), - OriginalValue = table.Column(maxLength: 512, nullable: true), - PropertyName = table.Column(maxLength: 128, nullable: false), - PropertyTypeFullName = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); - table.ForeignKey( - name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", - column: x => x.EntityChangeId, - principalTable: "AbpEntityChanges", - principalColumn: "Id", - 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", - column: "AuditLogId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", - table: "AbpAuditLogActions", - columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogs_TenantId_ExecutionTime", - table: "AbpAuditLogs", - columns: new[] { "TenantId", "ExecutionTime" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", - table: "AbpAuditLogs", - columns: new[] { "TenantId", "UserId", "ExecutionTime" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpEntityChanges_AuditLogId", - table: "AbpEntityChanges", - column: "AuditLogId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", - table: "AbpEntityChanges", - columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpEntityPropertyChanges_EntityChangeId", - table: "AbpEntityPropertyChanges", - column: "EntityChangeId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", - table: "AbpPermissionGrants", - columns: new[] { "Name", "ProviderName", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpRoleClaims_RoleId", - table: "AbpRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpRoles_NormalizedName", - table: "AbpRoles", - column: "NormalizedName"); - - migrationBuilder.CreateIndex( - name: "IX_AbpSettings_Name_ProviderName_ProviderKey", - table: "AbpSettings", - columns: new[] { "Name", "ProviderName", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpTenants_Name", - table: "AbpTenants", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AbpUserClaims_UserId", - table: "AbpUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUserLogins_LoginProvider_ProviderKey", - table: "AbpUserLogins", - columns: new[] { "LoginProvider", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpUserRoles_RoleId_UserId", - table: "AbpUserRoles", - columns: new[] { "RoleId", "UserId" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_Email", - table: "AbpUsers", - column: "Email"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_NormalizedEmail", - table: "AbpUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_NormalizedUserName", - table: "AbpUsers", - column: "NormalizedUserName"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_UserName", - table: "AbpUsers", - column: "UserName"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerClients_ClientId", - table: "IdentityServerClients", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerPersistedGrants_Expiration", - table: "IdentityServerPersistedGrants", - column: "Expiration"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", - table: "IdentityServerPersistedGrants", - columns: new[] { "SubjectId", "ClientId", "Type" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AbpAuditLogActions"); - - migrationBuilder.DropTable( - name: "AbpClaimTypes"); - - migrationBuilder.DropTable( - name: "AbpEntityPropertyChanges"); - - migrationBuilder.DropTable( - name: "AbpPermissionGrants"); - - migrationBuilder.DropTable( - name: "AbpRoleClaims"); - - migrationBuilder.DropTable( - name: "AbpSettings"); - - migrationBuilder.DropTable( - name: "AbpTenantConnectionStrings"); - - migrationBuilder.DropTable( - name: "AbpUserClaims"); - - migrationBuilder.DropTable( - name: "AbpUserLogins"); - - migrationBuilder.DropTable( - name: "AbpUserRoles"); - - migrationBuilder.DropTable( - name: "AbpUserTokens"); - - migrationBuilder.DropTable( - name: "IdentityServerApiClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerApiScopeClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerApiSecrets"); - - migrationBuilder.DropTable( - name: "IdentityServerClientClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerClientCorsOrigins"); - - migrationBuilder.DropTable( - name: "IdentityServerClientGrantTypes"); - - migrationBuilder.DropTable( - name: "IdentityServerClientIdPRestrictions"); - - migrationBuilder.DropTable( - name: "IdentityServerClientPostLogoutRedirectUris"); - - migrationBuilder.DropTable( - name: "IdentityServerClientProperties"); - - migrationBuilder.DropTable( - name: "IdentityServerClientRedirectUris"); - - migrationBuilder.DropTable( - name: "IdentityServerClientScopes"); - - migrationBuilder.DropTable( - name: "IdentityServerClientSecrets"); - - migrationBuilder.DropTable( - name: "IdentityServerIdentityClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerPersistedGrants"); - - migrationBuilder.DropTable( - name: "AbpEntityChanges"); - - migrationBuilder.DropTable( - name: "AbpTenants"); - - migrationBuilder.DropTable( - name: "AbpRoles"); - - migrationBuilder.DropTable( - name: "AbpUsers"); - - migrationBuilder.DropTable( - name: "IdentityServerApiScopes"); - - migrationBuilder.DropTable( - name: "IdentityServerClients"); - - migrationBuilder.DropTable( - name: "IdentityServerIdentityResources"); - - migrationBuilder.DropTable( - name: "AbpAuditLogs"); - - migrationBuilder.DropTable( - name: "IdentityServerApiResources"); - } - } -} diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.Designer.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.Designer.cs similarity index 96% rename from samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.Designer.cs rename to samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.Designer.cs index 58a98448a6b..226a9a8c6c5 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.Designer.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.Designer.cs @@ -1,23 +1,23 @@ // using System; -using Acme.BookStore.EntityFrameworkCore; +using Acme.BookStore.BookManagement.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace Acme.BookStore.Migrations +namespace Acme.BookStore.BookManagement.Migrations { - [DbContext(typeof(BookStoreMigrationsDbContext))] - [Migration("20191018081718_Initial")] + [DbContext(typeof(IdentityServerHostMigrationsDbContext))] + [Migration("20200106082830_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -268,92 +268,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AbpEntityPropertyChanges"); }); - modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("IsAbandoned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("JobArgs") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(1048576); - - b.Property("JobName") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("LastTryTime") - .HasColumnType("datetime2"); - - b.Property("NextTryTime") - .HasColumnType("datetime2"); - - b.Property("Priority") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint") - .HasDefaultValue((byte)15); - - b.Property("TryCount") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)0); - - b.HasKey("Id"); - - b.HasIndex("IsAbandoned", "NextTryTime"); - - b.ToTable("AbpBackgroundJobs"); - }); - - modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderName") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpFeatureValues"); - }); - modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") @@ -512,6 +426,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -555,6 +470,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1197,6 +1113,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1453,8 +1433,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.cs new file mode 100644 index 00000000000..29fd4e6387a --- /dev/null +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/20200106082830_Initial.cs @@ -0,0 +1,1022 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Acme.BookStore.BookManagement.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + ApplicationName = table.Column(maxLength: 96, nullable: true), + UserId = table.Column(nullable: true), + UserName = table.Column(maxLength: 256, nullable: true), + TenantId = table.Column(nullable: true), + TenantName = table.Column(nullable: true), + ImpersonatorUserId = table.Column(nullable: true), + ImpersonatorTenantId = table.Column(nullable: true), + ExecutionTime = table.Column(nullable: false), + ExecutionDuration = table.Column(nullable: false), + ClientIpAddress = table.Column(maxLength: 64, nullable: true), + ClientName = table.Column(maxLength: 128, nullable: true), + ClientId = table.Column(maxLength: 64, nullable: true), + CorrelationId = table.Column(maxLength: 64, nullable: true), + BrowserInfo = table.Column(maxLength: 512, nullable: true), + HttpMethod = table.Column(maxLength: 16, nullable: true), + Url = table.Column(maxLength: 256, nullable: true), + Exceptions = table.Column(maxLength: 4000, nullable: true), + Comments = table.Column(maxLength: 256, nullable: true), + HttpStatusCode = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), + Name = table.Column(maxLength: 256, nullable: false), + Required = table.Column(nullable: false), + IsStatic = table.Column(nullable: false), + Regex = table.Column(maxLength: 512, nullable: true), + RegexDescription = table.Column(maxLength: 128, nullable: true), + Description = table.Column(maxLength: 256, nullable: true), + ValueType = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + Name = table.Column(maxLength: 128, nullable: false), + ProviderName = table.Column(maxLength: 64, nullable: false), + ProviderKey = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), + TenantId = table.Column(nullable: true), + Name = table.Column(maxLength: 256, nullable: false), + NormalizedName = table.Column(maxLength: 256, nullable: false), + IsDefault = table.Column(nullable: false), + IsStatic = table.Column(nullable: false), + IsPublic = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(nullable: false), + Name = table.Column(maxLength: 128, nullable: false), + Value = table.Column(maxLength: 2048, nullable: false), + ProviderName = table.Column(maxLength: 64, nullable: true), + ProviderKey = table.Column(maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + Name = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + TenantId = table.Column(nullable: true), + UserName = table.Column(maxLength: 256, nullable: false), + NormalizedUserName = table.Column(maxLength: 256, nullable: false), + Name = table.Column(maxLength: 64, nullable: true), + Surname = table.Column(maxLength: 64, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), + EmailConfirmed = table.Column(nullable: false, defaultValue: false), + PasswordHash = table.Column(maxLength: 256, nullable: true), + SecurityStamp = table.Column(maxLength: 256, nullable: false), + PhoneNumber = table.Column(maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), + TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), + LockoutEnd = table.Column(nullable: true), + LockoutEnabled = table.Column(nullable: false, defaultValue: false), + AccessFailedCount = table.Column(nullable: false, defaultValue: 0) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResources", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + Enabled = table.Column(nullable: false), + Properties = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClients", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + ClientId = table.Column(maxLength: 200, nullable: false), + ClientName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + ClientUri = table.Column(maxLength: 2000, nullable: true), + LogoUri = table.Column(maxLength: 2000, nullable: true), + Enabled = table.Column(nullable: false), + ProtocolType = table.Column(maxLength: 200, nullable: false), + RequireClientSecret = table.Column(nullable: false), + RequireConsent = table.Column(nullable: false), + AllowRememberConsent = table.Column(nullable: false), + AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), + RequirePkce = table.Column(nullable: false), + AllowPlainTextPkce = table.Column(nullable: false), + AllowAccessTokensViaBrowser = table.Column(nullable: false), + FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + FrontChannelLogoutSessionRequired = table.Column(nullable: false), + BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + BackChannelLogoutSessionRequired = table.Column(nullable: false), + AllowOfflineAccess = table.Column(nullable: false), + IdentityTokenLifetime = table.Column(nullable: false), + AccessTokenLifetime = table.Column(nullable: false), + AuthorizationCodeLifetime = table.Column(nullable: false), + ConsentLifetime = table.Column(nullable: true), + AbsoluteRefreshTokenLifetime = table.Column(nullable: false), + SlidingRefreshTokenLifetime = table.Column(nullable: false), + RefreshTokenUsage = table.Column(nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false), + RefreshTokenExpiration = table.Column(nullable: false), + AccessTokenType = table.Column(nullable: false), + EnableLocalLogin = table.Column(nullable: false), + IncludeJwtId = table.Column(nullable: false), + AlwaysSendClientClaims = table.Column(nullable: false), + ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClients", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResources", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + 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) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerPersistedGrants", + columns: table => new + { + Key = table.Column(maxLength: 200, nullable: false), + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + Type = table.Column(maxLength: 50, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + CreationTime = table.Column(nullable: false), + Expiration = table.Column(nullable: true), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); + }); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + AuditLogId = table.Column(nullable: false), + ServiceName = table.Column(maxLength: 256, nullable: true), + MethodName = table.Column(maxLength: 128, nullable: true), + Parameters = table.Column(maxLength: 2000, nullable: true), + ExecutionTime = table.Column(nullable: false), + ExecutionDuration = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(nullable: false), + AuditLogId = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + ChangeTime = table.Column(nullable: false), + ChangeType = table.Column(nullable: false), + EntityTenantId = table.Column(nullable: true), + EntityId = table.Column(maxLength: 128, nullable: false), + EntityTypeFullName = table.Column(maxLength: 128, nullable: false), + ExtraProperties = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + ClaimType = table.Column(maxLength: 256, nullable: false), + ClaimValue = table.Column(maxLength: 1024, nullable: true), + RoleId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(nullable: false), + Name = table.Column(maxLength: 64, nullable: false), + Value = table.Column(maxLength: 1024, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + ClaimType = table.Column(maxLength: 256, nullable: false), + ClaimValue = table.Column(maxLength: 1024, nullable: true), + UserId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(nullable: false), + LoginProvider = table.Column(maxLength: 64, nullable: false), + TenantId = table.Column(nullable: true), + ProviderKey = table.Column(maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(nullable: false), + RoleId = table.Column(nullable: false), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(nullable: false), + LoginProvider = table.Column(maxLength: 64, nullable: false), + Name = table.Column(maxLength: 128, nullable: false), + TenantId = table.Column(nullable: true), + Value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiClaims", + columns: table => new + { + Type = table.Column(maxLength: 200, nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + 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) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); + table.ForeignKey( + name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiSecrets", + 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), + Expiration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientClaims", + columns: table => new + { + ClientId = table.Column(nullable: false), + Type = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientCorsOrigins", + columns: table => new + { + ClientId = table.Column(nullable: false), + Origin = table.Column(maxLength: 150, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); + table.ForeignKey( + name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientGrantTypes", + columns: table => new + { + ClientId = table.Column(nullable: false), + GrantType = table.Column(maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); + table.ForeignKey( + name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientIdPRestrictions", + columns: table => new + { + ClientId = table.Column(nullable: false), + Provider = table.Column(maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); + table.ForeignKey( + name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientPostLogoutRedirectUris", + columns: table => new + { + ClientId = table.Column(nullable: false), + PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientProperties", + columns: table => new + { + ClientId = table.Column(nullable: false), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); + table.ForeignKey( + name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientRedirectUris", + columns: table => new + { + ClientId = table.Column(nullable: false), + RedirectUri = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientScopes", + columns: table => new + { + ClientId = table.Column(nullable: false), + Scope = table.Column(maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientSecrets", + columns: table => new + { + Type = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 4000, nullable: false), + ClientId = table.Column(nullable: false), + Description = table.Column(maxLength: 2000, nullable: true), + Expiration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityClaims", + columns: table => new + { + Type = table.Column(maxLength: 200, nullable: false), + IdentityResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + EntityChangeId = table.Column(nullable: false), + NewValue = table.Column(maxLength: 512, nullable: true), + OriginalValue = table.Column(maxLength: 512, nullable: true), + PropertyName = table.Column(maxLength: 128, nullable: false), + PropertyTypeFullName = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + 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", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "Name", "ProviderName", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClients_ClientId", + table: "IdentityServerClients", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_Expiration", + table: "IdentityServerPersistedGrants", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "IdentityServerApiClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerClientClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerClientCorsOrigins"); + + migrationBuilder.DropTable( + name: "IdentityServerClientGrantTypes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientIdPRestrictions"); + + migrationBuilder.DropTable( + name: "IdentityServerClientPostLogoutRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerPersistedGrants"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClients"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResources"); + + migrationBuilder.DropTable( + name: "AbpAuditLogs"); + + migrationBuilder.DropTable( + name: "IdentityServerApiResources"); + } + } +} diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs index 6dceb1571b2..57cf043bd16 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/Migrations/IdentityServerHostMigrationsDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -424,6 +424,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -467,6 +468,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1109,6 +1111,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1365,8 +1431,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.Designer.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.Designer.cs deleted file mode 100644 index 1ed05a4c4bc..00000000000 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.Designer.cs +++ /dev/null @@ -1,716 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Acme.BookStore.BookManagement.EntityFrameworkCore; - -namespace Acme.BookStore.BookManagement.Migrations -{ - [DbContext(typeof(UnifiedDbContext))] - [Migration("20190527144415_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationName") - .HasColumnName("ApplicationName") - .HasMaxLength(96); - - b.Property("BrowserInfo") - .HasColumnName("BrowserInfo") - .HasMaxLength(512); - - b.Property("ClientId") - .HasColumnName("ClientId") - .HasMaxLength(64); - - b.Property("ClientIpAddress") - .HasColumnName("ClientIpAddress") - .HasMaxLength(64); - - b.Property("ClientName") - .HasColumnName("ClientName") - .HasMaxLength(128); - - b.Property("Comments") - .HasColumnName("Comments") - .HasMaxLength(256); - - b.Property("ConcurrencyStamp"); - - b.Property("CorrelationId") - .HasColumnName("CorrelationId") - .HasMaxLength(64); - - b.Property("Exceptions") - .HasColumnName("Exceptions") - .HasMaxLength(4000); - - b.Property("ExecutionDuration") - .HasColumnName("ExecutionDuration"); - - b.Property("ExecutionTime"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("HttpMethod") - .HasColumnName("HttpMethod") - .HasMaxLength(16); - - b.Property("HttpStatusCode") - .HasColumnName("HttpStatusCode"); - - b.Property("ImpersonatorTenantId") - .HasColumnName("ImpersonatorTenantId"); - - b.Property("ImpersonatorUserId") - .HasColumnName("ImpersonatorUserId"); - - b.Property("TenantId") - .HasColumnName("TenantId"); - - b.Property("TenantName"); - - b.Property("Url") - .HasColumnName("Url") - .HasMaxLength(256); - - b.Property("UserId") - .HasColumnName("UserId"); - - b.Property("UserName") - .HasColumnName("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "ExecutionTime"); - - b.HasIndex("TenantId", "UserId", "ExecutionTime"); - - b.ToTable("AbpAuditLogs"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AuditLogId") - .HasColumnName("AuditLogId"); - - b.Property("ExecutionDuration") - .HasColumnName("ExecutionDuration"); - - b.Property("ExecutionTime") - .HasColumnName("ExecutionTime"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("MethodName") - .HasColumnName("MethodName") - .HasMaxLength(128); - - b.Property("Parameters") - .HasColumnName("Parameters") - .HasMaxLength(2000); - - b.Property("ServiceName") - .HasColumnName("ServiceName") - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("AuditLogId"); - - b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); - - b.ToTable("AbpAuditLogActions"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AuditLogId") - .HasColumnName("AuditLogId"); - - b.Property("ChangeTime") - .HasColumnName("ChangeTime"); - - b.Property("ChangeType") - .HasColumnName("ChangeType"); - - b.Property("EntityId") - .IsRequired() - .HasColumnName("EntityId") - .HasMaxLength(128); - - b.Property("EntityTenantId"); - - b.Property("EntityTypeFullName") - .IsRequired() - .HasColumnName("EntityTypeFullName") - .HasMaxLength(128); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("TenantId") - .HasColumnName("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("AuditLogId"); - - b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); - - b.ToTable("AbpEntityChanges"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("EntityChangeId"); - - b.Property("NewValue") - .HasColumnName("NewValue") - .HasMaxLength(512); - - b.Property("OriginalValue") - .HasColumnName("OriginalValue") - .HasMaxLength(512); - - b.Property("PropertyName") - .IsRequired() - .HasColumnName("PropertyName") - .HasMaxLength(128); - - b.Property("PropertyTypeFullName") - .IsRequired() - .HasColumnName("PropertyTypeFullName") - .HasMaxLength(64); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("EntityChangeId"); - - b.ToTable("AbpEntityPropertyChanges"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasColumnName("ConcurrencyStamp") - .HasMaxLength(256); - - b.Property("Description") - .HasMaxLength(256); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("IsStatic"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("Regex") - .HasMaxLength(512); - - b.Property("RegexDescription") - .HasMaxLength(128); - - b.Property("Required"); - - b.Property("ValueType"); - - b.HasKey("Id"); - - b.ToTable("AbpClaimTypes"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasColumnName("ConcurrencyStamp") - .HasMaxLength(256); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("IsDefault") - .HasColumnName("IsDefault"); - - b.Property("IsPublic") - .HasColumnName("IsPublic"); - - b.Property("IsStatic") - .HasColumnName("IsStatic"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(256); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName"); - - b.ToTable("AbpRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AbpRoleClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount") - .ValueGeneratedOnAdd() - .HasColumnName("AccessFailedCount") - .HasDefaultValue(0); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnName("DeletionTime"); - - b.Property("Email") - .HasColumnName("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("EmailConfirmed") - .HasDefaultValue(false); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") - .HasDefaultValue(false); - - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnName("LastModifierId"); - - b.Property("LockoutEnabled") - .ValueGeneratedOnAdd() - .HasColumnName("LockoutEnabled") - .HasDefaultValue(false); - - b.Property("LockoutEnd"); - - b.Property("Name") - .HasColumnName("Name") - .HasMaxLength(64); - - b.Property("NormalizedEmail") - .HasColumnName("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .IsRequired() - .HasColumnName("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnName("PasswordHash") - .HasMaxLength(256); - - b.Property("PhoneNumber") - .HasColumnName("PhoneNumber") - .HasMaxLength(16); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnName("PhoneNumberConfirmed") - .HasDefaultValue(false); - - b.Property("SecurityStamp") - .IsRequired() - .HasColumnName("SecurityStamp") - .HasMaxLength(256); - - b.Property("Surname") - .HasColumnName("Surname") - .HasMaxLength(64); - - b.Property("TenantId") - .HasColumnName("TenantId"); - - b.Property("TwoFactorEnabled") - .ValueGeneratedOnAdd() - .HasColumnName("TwoFactorEnabled") - .HasDefaultValue(false); - - b.Property("UserName") - .IsRequired() - .HasColumnName("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("Email"); - - b.HasIndex("NormalizedEmail"); - - b.HasIndex("NormalizedUserName"); - - b.HasIndex("UserName"); - - b.ToTable("AbpUsers"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType") - .IsRequired() - .HasMaxLength(256); - - b.Property("ClaimValue") - .HasMaxLength(1024); - - b.Property("TenantId"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AbpUserClaims"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("ProviderDisplayName") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(196); - - b.Property("TenantId"); - - b.HasKey("UserId", "LoginProvider"); - - b.HasIndex("LoginProvider", "ProviderKey"); - - b.ToTable("AbpUserLogins"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.Property("TenantId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId", "UserId"); - - b.ToTable("AbpUserRoles"); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider") - .HasMaxLength(64); - - b.Property("Name") - .HasMaxLength(128); - - b.Property("TenantId"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AbpUserTokens"); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasMaxLength(64); - - b.Property("TenantId"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Name") - .IsRequired() - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasMaxLength(64); - - b.Property("ProviderName") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasMaxLength(2048); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpSettings"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnName("DeletionTime"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") - .HasDefaultValue(false); - - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnName("LastModifierId"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("AbpTenants"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.Property("TenantId"); - - b.Property("Name") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("AbpTenantConnectionStrings"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("Actions") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog") - .WithMany("EntityChanges") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => - { - b.HasOne("Volo.Abp.AuditLogging.EntityChange") - .WithMany("PropertyChanges") - .HasForeignKey("EntityChangeId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany("Claims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Claims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => - { - b.HasOne("Volo.Abp.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Roles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => - { - b.HasOne("Volo.Abp.Identity.IdentityUser") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.TenantManagement.Tenant") - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.Designer.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.Designer.cs similarity index 56% rename from samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.Designer.cs rename to samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.Designer.cs index 874183e1eec..caf8dac8ce2 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.Designer.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.Designer.cs @@ -1,26 +1,76 @@ // using System; -using AuthServer.Host.EntityFrameworkCore; +using Acme.BookStore.BookManagement.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace AuthServer.Host.Migrations +namespace Acme.BookStore.BookManagement.Migrations { - [DbContext(typeof(AuthServerDbContext))] - [Migration("20191018081320_Initial")] + [DbContext(typeof(UnifiedDbContext))] + [Migration("20200106082340_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + modelBuilder.Entity("Acme.BookStore.BookManagement.Books.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Price") + .HasColumnType("real"); + + b.Property("PublishDate") + .HasColumnType("datetime2"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("BmBooks"); + }); + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property("Id") @@ -426,6 +476,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -469,6 +520,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -632,231 +684,79 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AbpUserTokens"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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); - - b.Property("DisplayName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - 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("Properties") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerApiResources"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.Property("ApiResourceId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); - b.HasKey("ApiResourceId", "Type"); + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); - b.ToTable("IdentityServerApiClaims"); - }); + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.Property("ApiResourceId") + b.Property("TenantId") .HasColumnType("uniqueidentifier"); - b.Property("Name") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("DisplayName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Emphasize") - .HasColumnType("bit"); - - b.Property("Required") - .HasColumnType("bit"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("bit"); + b.HasKey("Id"); - b.HasKey("ApiResourceId", "Name"); + b.HasIndex("Name", "ProviderName", "ProviderKey"); - b.ToTable("IdentityServerApiScopes"); + b.ToTable("AbpPermissionGrants"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { - b.Property("ApiResourceId") + b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); b.Property("Name") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Type") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ApiResourceId", "Name", "Type"); - - b.ToTable("IdentityServerApiScopeClaims"); - }); + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.Property("ApiResourceId") - .HasColumnType("uniqueidentifier"); + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); - b.Property("Type") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); b.Property("Value") - .HasColumnType("nvarchar(4000)") - .HasMaxLength(4000); - - b.Property("Description") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); - b.Property("Expiration") - .HasColumnType("datetime2"); + b.HasKey("Id"); - b.HasKey("ApiResourceId", "Type", "Value"); + b.HasIndex("Name", "ProviderName", "ProviderKey"); - b.ToTable("IdentityServerApiSecrets"); + b.ToTable("AbpSettings"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("AbsoluteRefreshTokenLifetime") - .HasColumnType("int"); - - b.Property("AccessTokenLifetime") - .HasColumnType("int"); - - b.Property("AccessTokenType") - .HasColumnType("int"); - - b.Property("AllowAccessTokensViaBrowser") - .HasColumnType("bit"); - - b.Property("AllowOfflineAccess") - .HasColumnType("bit"); - - b.Property("AllowPlainTextPkce") - .HasColumnType("bit"); - - b.Property("AllowRememberConsent") - .HasColumnType("bit"); - - b.Property("AlwaysIncludeUserClaimsInIdToken") - .HasColumnType("bit"); - - b.Property("AlwaysSendClientClaims") - .HasColumnType("bit"); - - b.Property("AuthorizationCodeLifetime") - .HasColumnType("int"); - - b.Property("BackChannelLogoutSessionRequired") - .HasColumnType("bit"); - - b.Property("BackChannelLogoutUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("ClientClaimsPrefix") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("nvarchar(max)"); - b.Property("ConsentLifetime") - .HasColumnType("int"); - b.Property("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); @@ -873,36 +773,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnName("DeletionTime") .HasColumnType("datetime2"); - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("DeviceCodeLifetime") - .HasColumnType("int"); - - b.Property("EnableLocalLogin") - .HasColumnType("bit"); - - b.Property("Enabled") - .HasColumnType("bit"); - b.Property("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("nvarchar(max)"); - b.Property("FrontChannelLogoutSessionRequired") - .HasColumnType("bit"); - - b.Property("FrontChannelLogoutUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("IdentityTokenLifetime") - .HasColumnType("int"); - - b.Property("IncludeJwtId") - .HasColumnType("bit"); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") @@ -917,414 +791,47 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnName("LastModifierId") .HasColumnType("uniqueidentifier"); - b.Property("LogoUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.Property("PairWiseSubjectSalt") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ProtocolType") + b.Property("Name") .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("RefreshTokenExpiration") - .HasColumnType("int"); - - b.Property("RefreshTokenUsage") - .HasColumnType("int"); - - b.Property("RequireClientSecret") - .HasColumnType("bit"); - - b.Property("RequireConsent") - .HasColumnType("bit"); - - b.Property("RequirePkce") - .HasColumnType("bit"); - - b.Property("SlidingRefreshTokenLifetime") - .HasColumnType("int"); - - b.Property("UpdateAccessTokenClaimsOnRefresh") - .HasColumnType("bit"); - - b.Property("UserCodeType") - .HasColumnType("nvarchar(100)") - .HasMaxLength(100); - - b.Property("UserSsoLifetime") - .HasColumnType("int"); + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); b.HasKey("Id"); - b.HasIndex("ClientId"); + b.HasIndex("Name"); - b.ToTable("IdentityServerClients"); + b.ToTable("AbpTenants"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { - b.Property("ClientId") + b.Property("TenantId") .HasColumnType("uniqueidentifier"); - b.Property("Type") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); b.Property("Value") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); - b.HasKey("ClientId", "Type", "Value"); + b.HasKey("TenantId", "Name"); - b.ToTable("IdentityServerClientClaims"); + b.ToTable("AbpTenantConnectionStrings"); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Origin") - .HasColumnType("nvarchar(150)") - .HasMaxLength(150); - - b.HasKey("ClientId", "Origin"); - - b.ToTable("IdentityServerClientCorsOrigins"); + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("GrantType") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.HasKey("ClientId", "GrantType"); - - b.ToTable("IdentityServerClientGrantTypes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Provider") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ClientId", "Provider"); - - b.ToTable("IdentityServerClientIdPRestrictions"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("PostLogoutRedirectUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.HasKey("ClientId", "PostLogoutRedirectUri"); - - b.ToTable("IdentityServerClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Key") - .HasColumnType("nvarchar(250)") - .HasMaxLength(250); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.HasKey("ClientId", "Key"); - - b.ToTable("IdentityServerClientProperties"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("RedirectUri") - .HasColumnType("nvarchar(2000)") - .HasMaxLength(2000); - - b.HasKey("ClientId", "RedirectUri"); - - b.ToTable("IdentityServerClientRedirectUris"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Scope") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("ClientId", "Scope"); - - b.ToTable("IdentityServerClientScopes"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.Property("ClientId") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .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("ClientId", "Type", "Value"); - - b.ToTable("IdentityServerClientSecrets"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => - { - b.Property("Key") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Data") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(50000); - - b.Property("Expiration") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("SubjectId") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.Property("Type") - .IsRequired() - .HasColumnType("nvarchar(50)") - .HasMaxLength(50); - - b.HasKey("Key"); - - b.HasIndex("Expiration"); - - b.HasIndex("SubjectId", "ClientId", "Type"); - - b.ToTable("IdentityServerPersistedGrants"); - }); - - 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"); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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); - - b.Property("DisplayName") - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - 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("Properties") - .HasColumnType("nvarchar(max)"); - - b.Property("Required") - .HasColumnType("bit"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("IdentityServerIdentityResources"); - }); - - modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .IsRequired() - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderName") - .IsRequired() - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpPermissionGrants"); - }); - - modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderName") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(2048)") - .HasMaxLength(2048); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpSettings"); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => - { - b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) - .WithMany("Actions") - .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) .WithMany("EntityChanges") @@ -1393,128 +900,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId", "Name") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => - { - b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { - b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.cs similarity index 95% rename from samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.cs rename to samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.cs index 3fedb57cbdb..ffe7dc0462a 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20190527144415_Initial.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/20200106082340_Initial.cs @@ -148,8 +148,8 @@ protected override void Up(MigrationBuilder migrationBuilder) NormalizedUserName = table.Column(maxLength: 256, nullable: false), Name = table.Column(maxLength: 64, nullable: true), Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), EmailConfirmed = table.Column(nullable: false, defaultValue: false), PasswordHash = table.Column(maxLength: 256, nullable: true), SecurityStamp = table.Column(maxLength: 256, nullable: false), @@ -165,6 +165,27 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_AbpUsers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "BmBooks", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + LastModificationTime = table.Column(nullable: true), + LastModifierId = table.Column(nullable: true), + Name = table.Column(maxLength: 128, nullable: false), + Type = table.Column(nullable: false), + PublishDate = table.Column(nullable: false), + Price = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BmBooks", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpAuditLogActions", columns: table => new @@ -424,8 +445,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_AbpTenants_Name", table: "AbpTenants", - column: "Name", - unique: true); + column: "Name"); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", @@ -498,6 +518,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "AbpUserTokens"); + migrationBuilder.DropTable( + name: "BmBooks"); + migrationBuilder.DropTable( name: "AbpEntityChanges"); diff --git a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index 3f0e01c2bb8..1a18f427085 100644 --- a/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -1,10 +1,10 @@ // using System; +using Acme.BookStore.BookManagement.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Acme.BookStore.BookManagement.EntityFrameworkCore; namespace Acme.BookStore.BookManagement.Migrations { @@ -15,84 +15,156 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + modelBuilder.Entity("Acme.BookStore.BookManagement.Books.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Price") + .HasColumnType("real"); + + b.Property("PublishDate") + .HasColumnType("datetime2"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("BmBooks"); + }); + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("ApplicationName") .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") .HasMaxLength(96); b.Property("BrowserInfo") .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property("ClientId") .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("ClientIpAddress") .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("ClientName") .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("Comments") .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); - b.Property("ConcurrencyStamp"); + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); b.Property("CorrelationId") .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("Exceptions") .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") .HasMaxLength(4000); b.Property("ExecutionDuration") - .HasColumnName("ExecutionDuration"); + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); - b.Property("ExecutionTime"); + b.Property("ExecutionTime") + .HasColumnType("datetime2"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); b.Property("HttpMethod") .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") .HasMaxLength(16); b.Property("HttpStatusCode") - .HasColumnName("HttpStatusCode"); + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); b.Property("ImpersonatorTenantId") - .HasColumnName("ImpersonatorTenantId"); + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); b.Property("ImpersonatorUserId") - .HasColumnName("ImpersonatorUserId"); + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); b.Property("TenantId") - .HasColumnName("TenantId"); + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); - b.Property("TenantName"); + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); b.Property("Url") .HasColumnName("Url") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("UserId") - .HasColumnName("UserId"); + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); b.Property("UserName") .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); @@ -107,33 +179,42 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("AuditLogId") - .HasColumnName("AuditLogId"); + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); b.Property("ExecutionDuration") - .HasColumnName("ExecutionDuration"); + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); b.Property("ExecutionTime") - .HasColumnName("ExecutionTime"); + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); b.Property("MethodName") .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("Parameters") .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") .HasMaxLength(2000); b.Property("ServiceName") .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -147,34 +228,43 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("AuditLogId") - .HasColumnName("AuditLogId"); + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); b.Property("ChangeTime") - .HasColumnName("ChangeTime"); + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); b.Property("ChangeType") - .HasColumnName("ChangeType"); + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); b.Property("EntityId") .IsRequired() .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); - b.Property("EntityTenantId"); + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); b.Property("EntityTypeFullName") .IsRequired() .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); b.Property("TenantId") - .HasColumnName("TenantId"); + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -188,29 +278,36 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); - b.Property("EntityChangeId"); + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); b.Property("NewValue") .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property("OriginalValue") .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property("PropertyName") .IsRequired() .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("PropertyTypeFullName") .IsRequired() .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -222,35 +319,45 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("Description") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); - b.Property("IsStatic"); + b.Property("IsStatic") + .HasColumnType("bit"); b.Property("Name") .IsRequired() + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("Regex") + .HasColumnType("nvarchar(512)") .HasMaxLength(512); b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); - b.Property("Required"); + b.Property("Required") + .HasColumnType("bit"); - b.Property("ValueType"); + b.Property("ValueType") + .HasColumnType("int"); b.HasKey("Id"); @@ -260,35 +367,44 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); b.Property("IsDefault") - .HasColumnName("IsDefault"); + .HasColumnName("IsDefault") + .HasColumnType("bit"); b.Property("IsPublic") - .HasColumnName("IsPublic"); + .HasColumnName("IsPublic") + .HasColumnType("bit"); b.Property("IsStatic") - .HasColumnName("IsStatic"); + .HasColumnName("IsStatic") + .HasColumnType("bit"); b.Property("Name") .IsRequired() + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("NormalizedName") .IsRequired() + .HasColumnType("nvarchar(256)") .HasMaxLength(256); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -300,18 +416,22 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .HasColumnType("uniqueidentifier"); b.Property("ClaimType") .IsRequired() + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); - b.Property("RoleId"); + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -323,105 +443,133 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("AccessFailedCount") .ValueGeneratedOnAdd() .HasColumnName("AccessFailedCount") + .HasColumnType("int") .HasDefaultValue(0); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp"); + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); b.Property("CreationTime") - .HasColumnName("CreationTime"); + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); b.Property("CreatorId") - .HasColumnName("CreatorId"); + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); b.Property("DeleterId") - .HasColumnName("DeleterId"); + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); b.Property("DeletionTime") - .HasColumnName("DeletionTime"); + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("EmailConfirmed") .ValueGeneratedOnAdd() .HasColumnName("EmailConfirmed") + .HasColumnType("bit") .HasDefaultValue(false); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") + .HasColumnType("bit") .HasDefaultValue(false); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime"); + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); b.Property("LastModifierId") - .HasColumnName("LastModifierId"); + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); b.Property("LockoutEnabled") .ValueGeneratedOnAdd() .HasColumnName("LockoutEnabled") + .HasColumnType("bit") .HasDefaultValue(false); - b.Property("LockoutEnd"); + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); b.Property("Name") .HasColumnName("Name") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("NormalizedUserName") .IsRequired() .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("PasswordHash") .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("PhoneNumber") .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") .HasMaxLength(16); b.Property("PhoneNumberConfirmed") .ValueGeneratedOnAdd() .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") .HasDefaultValue(false); b.Property("SecurityStamp") .IsRequired() .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("Surname") .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("TenantId") - .HasColumnName("TenantId"); + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); b.Property("TwoFactorEnabled") .ValueGeneratedOnAdd() .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") .HasDefaultValue(false); b.Property("UserName") .IsRequired() .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.HasKey("Id"); @@ -440,18 +588,22 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .HasColumnType("uniqueidentifier"); b.Property("ClaimType") .IsRequired() + .HasColumnType("nvarchar(256)") .HasMaxLength(256); b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); - b.Property("UserId"); + b.Property("UserId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -462,19 +614,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { - b.Property("UserId"); + b.Property("UserId") + .HasColumnType("uniqueidentifier"); b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("ProviderKey") .IsRequired() + .HasColumnType("nvarchar(196)") .HasMaxLength(196); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("UserId", "LoginProvider"); @@ -485,11 +642,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => { - b.Property("UserId"); + b.Property("UserId") + .HasColumnType("uniqueidentifier"); - b.Property("RoleId"); + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("UserId", "RoleId"); @@ -500,17 +660,22 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => { - b.Property("UserId"); + b.Property("UserId") + .HasColumnType("uniqueidentifier"); b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("Name") + .HasColumnType("nvarchar(128)") .HasMaxLength(128); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); - b.Property("Value"); + b.Property("Value") + .HasColumnType("nvarchar(max)"); b.HasKey("UserId", "LoginProvider", "Name"); @@ -520,21 +685,26 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("Name") .IsRequired() + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("ProviderKey") .IsRequired() + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("ProviderName") .IsRequired() + .HasColumnType("nvarchar(64)") .HasMaxLength(64); - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.HasKey("Id"); @@ -546,20 +716,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("Name") .IsRequired() + .HasColumnType("nvarchar(128)") .HasMaxLength(128); b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("ProviderName") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("Value") .IsRequired() + .HasColumnType("nvarchar(2048)") .HasMaxLength(2048); b.HasKey("Id"); @@ -572,59 +747,72 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp"); + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); b.Property("CreationTime") - .HasColumnName("CreationTime"); + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); b.Property("CreatorId") - .HasColumnName("CreatorId"); + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); b.Property("DeleterId") - .HasColumnName("DeleterId"); + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); b.Property("DeletionTime") - .HasColumnName("DeletionTime"); + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); b.Property("ExtraProperties") - .HasColumnName("ExtraProperties"); + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") + .HasColumnType("bit") .HasDefaultValue(false); b.Property("LastModificationTime") - .HasColumnName("LastModificationTime"); + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); b.Property("LastModifierId") - .HasColumnName("LastModifierId"); + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); b.Property("Name") .IsRequired() + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { - b.Property("TenantId"); + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); b.Property("Name") + .HasColumnType("nvarchar(64)") .HasMaxLength(64); b.Property("Value") .IsRequired() + .HasColumnType("nvarchar(1024)") .HasMaxLength(1024); b.HasKey("TenantId", "Name"); @@ -634,79 +822,89 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { - b.HasOne("Volo.Abp.AuditLogging.AuditLog") + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) .WithMany("Actions") .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => { - b.HasOne("Volo.Abp.AuditLogging.AuditLog") + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) .WithMany("EntityChanges") .HasForeignKey("AuditLogId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => { - b.HasOne("Volo.Abp.AuditLogging.EntityChange") + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) .WithMany("PropertyChanges") .HasForeignKey("EntityChangeId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => { - b.HasOne("Volo.Abp.Identity.IdentityRole") + b.HasOne("Volo.Abp.Identity.IdentityRole", null) .WithMany("Claims") .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => { - b.HasOne("Volo.Abp.Identity.IdentityUser") + b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Claims") .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { - b.HasOne("Volo.Abp.Identity.IdentityUser") + b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Logins") .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => { - b.HasOne("Volo.Abp.Identity.IdentityRole") + b.HasOne("Volo.Abp.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("Volo.Abp.Identity.IdentityUser") + b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Roles") .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => { - b.HasOne("Volo.Abp.Identity.IdentityUser") + b.HasOne("Volo.Abp.Identity.IdentityUser", null) .WithMany("Tokens") .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => { - b.HasOne("Volo.Abp.TenantManagement.Tenant") + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) .WithMany("ConnectionStrings") .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); }); #pragma warning restore 612, 618 } diff --git a/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/Acme.BookStore.BookManagement.Domain.Shared.csproj b/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/Acme.BookStore.BookManagement.Domain.Shared.csproj index 377f6df9b33..5237b88c14d 100644 --- a/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/Acme.BookStore.BookManagement.Domain.Shared.csproj +++ b/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/Acme.BookStore.BookManagement.Domain.Shared.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/BookManagementDomainSharedModule.cs b/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/BookManagementDomainSharedModule.cs index 7e56eb6f18e..0217782b5e6 100644 --- a/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/BookManagementDomainSharedModule.cs +++ b/samples/BookStore-Modular/modules/book-management/src/Acme.BookStore.BookManagement.Domain.Shared/BookManagementDomainSharedModule.cs @@ -2,7 +2,7 @@ using Volo.Abp.Localization; using Acme.BookStore.BookManagement.Localization; using Volo.Abp.Localization.ExceptionHandling; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.VirtualFileSystem; namespace Acme.BookStore.BookManagement diff --git a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/BookManagementTestBase.cs b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/BookManagementTestBase.cs index dea660609e8..2072748cf2d 100644 --- a/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/BookManagementTestBase.cs +++ b/samples/BookStore-Modular/modules/book-management/test/Acme.BookStore.BookManagement.TestBase/BookManagementTestBase.cs @@ -17,26 +17,6 @@ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationO options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -57,26 +37,6 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs index 95241feeb8c..6ac58cef9ee 100644 --- a/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs +++ b/samples/BookStore/src/Acme.BookStore.Domain.Shared/BookStoreDomainSharedModule.cs @@ -5,7 +5,7 @@ using Volo.Abp.Identity; using Volo.Abp.IdentityServer; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; using Volo.Abp.SettingManagement; diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018080014_Created_Book_Entity.Designer.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.Designer.cs similarity index 97% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018080014_Created_Book_Entity.Designer.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.Designer.cs index 3c433dbd58a..75e551cd05c 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018080014_Created_Book_Entity.Designer.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.Designer.cs @@ -10,67 +10,17 @@ namespace Acme.BookStore.Migrations { [DbContext(typeof(BookStoreMigrationsDbContext))] - [Migration("20191018080014_Created_Book_Entity")] - partial class Created_Book_Entity + [Migration("20200106080124_Initial")] + partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("Acme.BookStore.Book", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime2"); - - b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("uniqueidentifier"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime2"); - - b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Price") - .HasColumnType("real"); - - b.Property("PublishDate") - .HasColumnType("datetime2"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppBooks"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property("Id") @@ -562,6 +512,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -605,6 +556,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1247,6 +1199,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1503,8 +1519,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.cs similarity index 96% rename from samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.cs index cc04cddbf27..de6dd334dd6 100644 --- a/samples/BookStore-Modular/application/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018081718_Initial.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080124_Initial.cs @@ -184,8 +184,8 @@ protected override void Up(MigrationBuilder migrationBuilder) NormalizedUserName = table.Column(maxLength: 256, nullable: false), Name = table.Column(maxLength: 64, nullable: true), Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), EmailConfirmed = table.Column(nullable: false, defaultValue: false), PasswordHash = table.Column(maxLength: 256, nullable: true), SecurityStamp = table.Column(maxLength: 256, nullable: false), @@ -283,6 +283,27 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_IdentityServerClients", x => x.Id); }); + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + migrationBuilder.CreateTable( name: "IdentityServerIdentityResources", columns: table => new @@ -866,8 +887,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_AbpTenants_Name", table: "AbpTenants", - column: "Name", - unique: true); + column: "Name"); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", @@ -909,6 +929,23 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "IdentityServerClients", column: "ClientId"); + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_Expiration", table: "IdentityServerPersistedGrants", @@ -997,6 +1034,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "IdentityServerClientSecrets"); + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + migrationBuilder.DropTable( name: "IdentityServerIdentityClaims"); diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080206_Created_Book_Entity.Designer.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080206_Created_Book_Entity.Designer.cs new file mode 100644 index 00000000000..03c38553411 --- /dev/null +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080206_Created_Book_Entity.Designer.cs @@ -0,0 +1,1811 @@ +// +using System; +using Acme.BookStore.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Acme.BookStore.Migrations +{ + [DbContext(typeof(BookStoreMigrationsDbContext))] + [Migration("20200106080206_Created_Book_Entity")] + partial class Created_Book_Entity + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.0") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Acme.BookStore.Book", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Price") + .HasColumnType("real"); + + b.Property("PublishDate") + .HasColumnType("datetime2"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AppBooks"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + 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("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + 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("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", 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(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + 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); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + 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("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .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("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + 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"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + 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("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + 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("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(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018080014_Created_Book_Entity.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080206_Created_Book_Entity.cs similarity index 100% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018080014_Created_Book_Entity.cs rename to samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20200106080206_Created_Book_Entity.cs diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs index ced549a6161..21087299a62 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs +++ b/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/BookStoreMigrationsDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -560,6 +560,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -603,6 +604,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1245,6 +1247,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1501,8 +1567,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/BookStore/test/Acme.BookStore.TestBase/BookStoreTestBase.cs b/samples/BookStore/test/Acme.BookStore.TestBase/BookStoreTestBase.cs index 0f44532e7a7..979c344f933 100644 --- a/samples/BookStore/test/Acme.BookStore.TestBase/BookStoreTestBase.cs +++ b/samples/BookStore/test/Acme.BookStore.TestBase/BookStoreTestBase.cs @@ -18,26 +18,6 @@ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationO options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -58,26 +38,6 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs b/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs index 166ade18d6b..440fadf865b 100644 --- a/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs +++ b/samples/BookStore/test/Acme.BookStore.Web.Tests/BookStoreWebTestModule.cs @@ -12,7 +12,7 @@ using Volo.Abp; using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; diff --git a/samples/DashboardDemo/src/DashboardDemo.Domain.Shared/DashboardDemoDomainSharedModule.cs b/samples/DashboardDemo/src/DashboardDemo.Domain.Shared/DashboardDemoDomainSharedModule.cs index ad6d56630b7..dd9c1833ca5 100644 --- a/samples/DashboardDemo/src/DashboardDemo.Domain.Shared/DashboardDemoDomainSharedModule.cs +++ b/samples/DashboardDemo/src/DashboardDemo.Domain.Shared/DashboardDemoDomainSharedModule.cs @@ -5,7 +5,7 @@ using Volo.Abp.Identity; using Volo.Abp.IdentityServer; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; using Volo.Abp.SettingManagement; diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20191018081444_Initial.Designer.cs b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20200106080501_Initial.Designer.cs similarity index 96% rename from samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20191018081444_Initial.Designer.cs rename to samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20200106080501_Initial.Designer.cs index 7cf33e8b48d..f53d59ada92 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20191018081444_Initial.Designer.cs +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20200106080501_Initial.Designer.cs @@ -10,14 +10,14 @@ namespace DashboardDemo.Migrations { [DbContext(typeof(DashboardDemoMigrationsDbContext))] - [Migration("20191018081444_Initial")] + [Migration("20200106080501_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -512,6 +512,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -555,6 +556,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1197,6 +1199,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1453,8 +1519,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20191018081444_Initial.cs b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20200106080501_Initial.cs similarity index 96% rename from samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20191018081444_Initial.cs rename to samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20200106080501_Initial.cs index c866a459201..26ee745e1e8 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20191018081444_Initial.cs +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/20200106080501_Initial.cs @@ -184,8 +184,8 @@ protected override void Up(MigrationBuilder migrationBuilder) NormalizedUserName = table.Column(maxLength: 256, nullable: false), Name = table.Column(maxLength: 64, nullable: true), Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), EmailConfirmed = table.Column(nullable: false, defaultValue: false), PasswordHash = table.Column(maxLength: 256, nullable: true), SecurityStamp = table.Column(maxLength: 256, nullable: false), @@ -283,6 +283,27 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_IdentityServerClients", x => x.Id); }); + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + migrationBuilder.CreateTable( name: "IdentityServerIdentityResources", columns: table => new @@ -866,8 +887,7 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_AbpTenants_Name", table: "AbpTenants", - column: "Name", - unique: true); + column: "Name"); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", @@ -909,6 +929,23 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "IdentityServerClients", column: "ClientId"); + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_Expiration", table: "IdentityServerPersistedGrants", @@ -997,6 +1034,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "IdentityServerClientSecrets"); + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + migrationBuilder.DropTable( name: "IdentityServerIdentityClaims"); diff --git a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs index 7849c5b1983..c4f257e7d0f 100644 --- a/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs +++ b/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore.DbMigrations/Migrations/DashboardDemoMigrationsDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -510,6 +510,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -553,6 +554,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1195,6 +1197,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1451,8 +1517,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemoTestBase.cs b/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemoTestBase.cs index 937a515d145..057755dd146 100644 --- a/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemoTestBase.cs +++ b/samples/DashboardDemo/test/DashboardDemo.TestBase/DashboardDemoTestBase.cs @@ -18,26 +18,6 @@ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationO options.UseAutofac(); } - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -58,26 +38,6 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemoWebTestModule.cs b/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemoWebTestModule.cs index 9e551d04d10..1f7db0ce9c1 100644 --- a/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemoWebTestModule.cs +++ b/samples/DashboardDemo/test/DashboardDemo.Web.Tests/DashboardDemoWebTestModule.cs @@ -12,7 +12,7 @@ using Volo.Abp; using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.cs deleted file mode 100644 index a1448d0e0c1..00000000000 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20191018081320_Initial.cs +++ /dev/null @@ -1,930 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace AuthServer.Host.Migrations -{ - public partial class Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AbpAuditLogs", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - ApplicationName = table.Column(maxLength: 96, nullable: true), - UserId = table.Column(nullable: true), - UserName = table.Column(maxLength: 256, nullable: true), - TenantId = table.Column(nullable: true), - TenantName = table.Column(nullable: true), - ImpersonatorUserId = table.Column(nullable: true), - ImpersonatorTenantId = table.Column(nullable: true), - ExecutionTime = table.Column(nullable: false), - ExecutionDuration = table.Column(nullable: false), - ClientIpAddress = table.Column(maxLength: 64, nullable: true), - ClientName = table.Column(maxLength: 128, nullable: true), - ClientId = table.Column(maxLength: 64, nullable: true), - CorrelationId = table.Column(maxLength: 64, nullable: true), - BrowserInfo = table.Column(maxLength: 512, nullable: true), - HttpMethod = table.Column(maxLength: 16, nullable: true), - Url = table.Column(maxLength: 256, nullable: true), - Exceptions = table.Column(maxLength: 4000, nullable: true), - Comments = table.Column(maxLength: 256, nullable: true), - HttpStatusCode = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpClaimTypes", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), - Name = table.Column(maxLength: 256, nullable: false), - Required = table.Column(nullable: false), - IsStatic = table.Column(nullable: false), - Regex = table.Column(maxLength: 512, nullable: true), - RegexDescription = table.Column(maxLength: 128, nullable: true), - Description = table.Column(maxLength: 256, nullable: true), - ValueType = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpPermissionGrants", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - Name = table.Column(maxLength: 128, nullable: false), - ProviderName = table.Column(maxLength: 64, nullable: false), - ProviderKey = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpRoles", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), - TenantId = table.Column(nullable: true), - Name = table.Column(maxLength: 256, nullable: false), - NormalizedName = table.Column(maxLength: 256, nullable: false), - IsDefault = table.Column(nullable: false), - IsStatic = table.Column(nullable: false), - IsPublic = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpSettings", - columns: table => new - { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - Value = table.Column(maxLength: 2048, nullable: false), - ProviderName = table.Column(maxLength: 64, nullable: true), - ProviderKey = table.Column(maxLength: 64, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpSettings", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AbpUsers", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - TenantId = table.Column(nullable: true), - UserName = table.Column(maxLength: 256, nullable: false), - NormalizedUserName = table.Column(maxLength: 256, nullable: false), - Name = table.Column(maxLength: 64, nullable: true), - Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false, defaultValue: false), - PasswordHash = table.Column(maxLength: 256, nullable: true), - SecurityStamp = table.Column(maxLength: 256, nullable: false), - PhoneNumber = table.Column(maxLength: 16, nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), - TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), - LockoutEnd = table.Column(nullable: true), - LockoutEnabled = table.Column(nullable: false, defaultValue: false), - AccessFailedCount = table.Column(nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiResources", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - Name = table.Column(maxLength: 200, nullable: false), - DisplayName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - Enabled = table.Column(nullable: false), - Properties = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClients", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - ClientId = table.Column(maxLength: 200, nullable: false), - ClientName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - ClientUri = table.Column(maxLength: 2000, nullable: true), - LogoUri = table.Column(maxLength: 2000, nullable: true), - Enabled = table.Column(nullable: false), - ProtocolType = table.Column(maxLength: 200, nullable: false), - RequireClientSecret = table.Column(nullable: false), - RequireConsent = table.Column(nullable: false), - AllowRememberConsent = table.Column(nullable: false), - AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), - RequirePkce = table.Column(nullable: false), - AllowPlainTextPkce = table.Column(nullable: false), - AllowAccessTokensViaBrowser = table.Column(nullable: false), - FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), - FrontChannelLogoutSessionRequired = table.Column(nullable: false), - BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), - BackChannelLogoutSessionRequired = table.Column(nullable: false), - AllowOfflineAccess = table.Column(nullable: false), - IdentityTokenLifetime = table.Column(nullable: false), - AccessTokenLifetime = table.Column(nullable: false), - AuthorizationCodeLifetime = table.Column(nullable: false), - ConsentLifetime = table.Column(nullable: true), - AbsoluteRefreshTokenLifetime = table.Column(nullable: false), - SlidingRefreshTokenLifetime = table.Column(nullable: false), - RefreshTokenUsage = table.Column(nullable: false), - UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false), - RefreshTokenExpiration = table.Column(nullable: false), - AccessTokenType = table.Column(nullable: false), - EnableLocalLogin = table.Column(nullable: false), - IncludeJwtId = table.Column(nullable: false), - AlwaysSendClientClaims = table.Column(nullable: false), - ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), - PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), - UserSsoLifetime = table.Column(nullable: true), - UserCodeType = table.Column(maxLength: 100, nullable: true), - DeviceCodeLifetime = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerIdentityResources", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - Name = table.Column(maxLength: 200, nullable: false), - DisplayName = table.Column(maxLength: 200, nullable: true), - Description = table.Column(maxLength: 1000, nullable: true), - 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) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerPersistedGrants", - columns: table => new - { - Key = table.Column(maxLength: 200, nullable: false), - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - Type = table.Column(maxLength: 50, nullable: false), - SubjectId = table.Column(maxLength: 200, nullable: true), - ClientId = table.Column(maxLength: 200, nullable: false), - CreationTime = table.Column(nullable: false), - Expiration = table.Column(nullable: true), - Data = table.Column(maxLength: 50000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); - }); - - migrationBuilder.CreateTable( - name: "AbpAuditLogActions", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - AuditLogId = table.Column(nullable: false), - ServiceName = table.Column(maxLength: 256, nullable: true), - MethodName = table.Column(maxLength: 128, nullable: true), - Parameters = table.Column(maxLength: 2000, nullable: true), - ExecutionTime = table.Column(nullable: false), - ExecutionDuration = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); - table.ForeignKey( - name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", - column: x => x.AuditLogId, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpEntityChanges", - columns: table => new - { - Id = table.Column(nullable: false), - AuditLogId = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - ChangeTime = table.Column(nullable: false), - ChangeType = table.Column(nullable: false), - EntityTenantId = table.Column(nullable: true), - EntityId = table.Column(maxLength: 128, nullable: false), - EntityTypeFullName = table.Column(maxLength: 128, nullable: false), - ExtraProperties = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); - table.ForeignKey( - name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", - column: x => x.AuditLogId, - principalTable: "AbpAuditLogs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpRoleClaims_AbpRoles_RoleId", - column: x => x.RoleId, - principalTable: "AbpRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserClaims", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - ClaimType = table.Column(maxLength: 256, nullable: false), - ClaimValue = table.Column(maxLength: 1024, nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AbpUserClaims_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserLogins", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - TenantId = table.Column(nullable: true), - ProviderKey = table.Column(maxLength: 196, nullable: false), - ProviderDisplayName = table.Column(maxLength: 128, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); - table.ForeignKey( - name: "FK_AbpUserLogins_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserRoles", - columns: table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false), - TenantId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AbpUserRoles_AbpRoles_RoleId", - column: x => x.RoleId, - principalTable: "AbpRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AbpUserRoles_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpUserTokens", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 64, nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - TenantId = table.Column(nullable: true), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AbpUserTokens_AbpUsers_UserId", - column: x => x.UserId, - principalTable: "AbpUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiClaims", - columns: table => new - { - Type = table.Column(maxLength: 200, nullable: false), - ApiResourceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiScopes", - 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) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); - table.ForeignKey( - name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerApiSecrets", - 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), - Expiration = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", - column: x => x.ApiResourceId, - principalTable: "IdentityServerApiResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientClaims", - columns: table => new - { - ClientId = table.Column(nullable: false), - Type = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientCorsOrigins", - columns: table => new - { - ClientId = table.Column(nullable: false), - Origin = table.Column(maxLength: 150, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); - table.ForeignKey( - name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientGrantTypes", - columns: table => new - { - ClientId = table.Column(nullable: false), - GrantType = table.Column(maxLength: 250, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); - table.ForeignKey( - name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientIdPRestrictions", - columns: table => new - { - ClientId = table.Column(nullable: false), - Provider = table.Column(maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); - table.ForeignKey( - name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientPostLogoutRedirectUris", - columns: table => new - { - ClientId = table.Column(nullable: false), - PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); - table.ForeignKey( - name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientProperties", - columns: table => new - { - ClientId = table.Column(nullable: false), - Key = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); - table.ForeignKey( - name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientRedirectUris", - columns: table => new - { - ClientId = table.Column(nullable: false), - RedirectUri = table.Column(maxLength: 2000, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); - table.ForeignKey( - name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientScopes", - columns: table => new - { - ClientId = table.Column(nullable: false), - Scope = table.Column(maxLength: 200, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); - table.ForeignKey( - name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerClientSecrets", - columns: table => new - { - Type = table.Column(maxLength: 250, nullable: false), - Value = table.Column(maxLength: 4000, nullable: false), - ClientId = table.Column(nullable: false), - Description = table.Column(maxLength: 2000, nullable: true), - Expiration = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); - table.ForeignKey( - name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", - column: x => x.ClientId, - principalTable: "IdentityServerClients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "IdentityServerIdentityClaims", - columns: table => new - { - Type = table.Column(maxLength: 200, nullable: false), - IdentityResourceId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); - table.ForeignKey( - name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", - column: x => x.IdentityResourceId, - principalTable: "IdentityServerIdentityResources", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AbpEntityPropertyChanges", - columns: table => new - { - Id = table.Column(nullable: false), - TenantId = table.Column(nullable: true), - EntityChangeId = table.Column(nullable: false), - NewValue = table.Column(maxLength: 512, nullable: true), - OriginalValue = table.Column(maxLength: 512, nullable: true), - PropertyName = table.Column(maxLength: 128, nullable: false), - PropertyTypeFullName = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); - table.ForeignKey( - name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", - column: x => x.EntityChangeId, - principalTable: "AbpEntityChanges", - principalColumn: "Id", - 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", - column: "AuditLogId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", - table: "AbpAuditLogActions", - columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogs_TenantId_ExecutionTime", - table: "AbpAuditLogs", - columns: new[] { "TenantId", "ExecutionTime" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", - table: "AbpAuditLogs", - columns: new[] { "TenantId", "UserId", "ExecutionTime" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpEntityChanges_AuditLogId", - table: "AbpEntityChanges", - column: "AuditLogId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", - table: "AbpEntityChanges", - columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpEntityPropertyChanges_EntityChangeId", - table: "AbpEntityPropertyChanges", - column: "EntityChangeId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", - table: "AbpPermissionGrants", - columns: new[] { "Name", "ProviderName", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpRoleClaims_RoleId", - table: "AbpRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpRoles_NormalizedName", - table: "AbpRoles", - column: "NormalizedName"); - - migrationBuilder.CreateIndex( - name: "IX_AbpSettings_Name_ProviderName_ProviderKey", - table: "AbpSettings", - columns: new[] { "Name", "ProviderName", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpUserClaims_UserId", - table: "AbpUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUserLogins_LoginProvider_ProviderKey", - table: "AbpUserLogins", - columns: new[] { "LoginProvider", "ProviderKey" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpUserRoles_RoleId_UserId", - table: "AbpUserRoles", - columns: new[] { "RoleId", "UserId" }); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_Email", - table: "AbpUsers", - column: "Email"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_NormalizedEmail", - table: "AbpUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_NormalizedUserName", - table: "AbpUsers", - column: "NormalizedUserName"); - - migrationBuilder.CreateIndex( - name: "IX_AbpUsers_UserName", - table: "AbpUsers", - column: "UserName"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerClients_ClientId", - table: "IdentityServerClients", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerPersistedGrants_Expiration", - table: "IdentityServerPersistedGrants", - column: "Expiration"); - - migrationBuilder.CreateIndex( - name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", - table: "IdentityServerPersistedGrants", - columns: new[] { "SubjectId", "ClientId", "Type" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AbpAuditLogActions"); - - migrationBuilder.DropTable( - name: "AbpClaimTypes"); - - migrationBuilder.DropTable( - name: "AbpEntityPropertyChanges"); - - migrationBuilder.DropTable( - name: "AbpPermissionGrants"); - - migrationBuilder.DropTable( - name: "AbpRoleClaims"); - - migrationBuilder.DropTable( - name: "AbpSettings"); - - migrationBuilder.DropTable( - name: "AbpUserClaims"); - - migrationBuilder.DropTable( - name: "AbpUserLogins"); - - migrationBuilder.DropTable( - name: "AbpUserRoles"); - - migrationBuilder.DropTable( - name: "AbpUserTokens"); - - migrationBuilder.DropTable( - name: "IdentityServerApiClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerApiScopeClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerApiSecrets"); - - migrationBuilder.DropTable( - name: "IdentityServerClientClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerClientCorsOrigins"); - - migrationBuilder.DropTable( - name: "IdentityServerClientGrantTypes"); - - migrationBuilder.DropTable( - name: "IdentityServerClientIdPRestrictions"); - - migrationBuilder.DropTable( - name: "IdentityServerClientPostLogoutRedirectUris"); - - migrationBuilder.DropTable( - name: "IdentityServerClientProperties"); - - migrationBuilder.DropTable( - name: "IdentityServerClientRedirectUris"); - - migrationBuilder.DropTable( - name: "IdentityServerClientScopes"); - - migrationBuilder.DropTable( - name: "IdentityServerClientSecrets"); - - migrationBuilder.DropTable( - name: "IdentityServerIdentityClaims"); - - migrationBuilder.DropTable( - name: "IdentityServerPersistedGrants"); - - migrationBuilder.DropTable( - name: "AbpEntityChanges"); - - migrationBuilder.DropTable( - name: "AbpRoles"); - - migrationBuilder.DropTable( - name: "AbpUsers"); - - migrationBuilder.DropTable( - name: "IdentityServerApiScopes"); - - migrationBuilder.DropTable( - name: "IdentityServerClients"); - - migrationBuilder.DropTable( - name: "IdentityServerIdentityResources"); - - migrationBuilder.DropTable( - name: "AbpAuditLogs"); - - migrationBuilder.DropTable( - name: "IdentityServerApiResources"); - } - } -} diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.Designer.cs similarity index 96% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs rename to samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.Designer.cs index 0733f562cd4..d2a14947aa8 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.Designer.cs @@ -1,23 +1,23 @@ // using System; +using AuthServer.Host.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MyCompanyName.MyProjectName.EntityFrameworkCore; -namespace MyCompanyName.MyProjectName.Migrations +namespace AuthServer.Host.Migrations { - [DbContext(typeof(IdentityServerHostMigrationsDbContext))] - [Migration("20191127124541_Initial")] + [DbContext(typeof(AuthServerDbContext))] + [Migration("20200106080946_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -426,6 +426,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -469,6 +470,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1111,6 +1113,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1315,82 +1381,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AbpSettings"); }); - modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - 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("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(64)") - .HasMaxLength(64); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("AbpTenants"); - }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.Property("TenantId") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(1024)") - .HasMaxLength(1024); - - b.HasKey("TenantId", "Name"); - - b.ToTable("AbpTenantConnectionStrings"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) @@ -1594,15 +1584,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - - modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => - { - b.HasOne("Volo.Abp.TenantManagement.Tenant", null) - .WithMany("ConnectionStrings") - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); #pragma warning restore 612, 618 } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.cs similarity index 96% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs rename to samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.cs index 217c00a6466..7e1b1eb08c5 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/20200106080946_Initial.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace MyCompanyName.MyProjectName.Migrations +namespace AuthServer.Host.Migrations { public partial class Initial : Migration { @@ -108,27 +108,6 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_AbpSettings", x => x.Id); }); - migrationBuilder.CreateTable( - name: "AbpTenants", - columns: table => new - { - Id = table.Column(nullable: false), - ExtraProperties = table.Column(nullable: true), - ConcurrencyStamp = table.Column(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), - Name = table.Column(maxLength: 64, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpTenants", x => x.Id); - }); - migrationBuilder.CreateTable( name: "AbpUsers", columns: table => new @@ -148,8 +127,8 @@ protected override void Up(MigrationBuilder migrationBuilder) NormalizedUserName = table.Column(maxLength: 256, nullable: false), Name = table.Column(maxLength: 64, nullable: true), Surname = table.Column(maxLength: 64, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), EmailConfirmed = table.Column(nullable: false, defaultValue: false), PasswordHash = table.Column(maxLength: 256, nullable: true), SecurityStamp = table.Column(maxLength: 256, nullable: false), @@ -247,6 +226,27 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_IdentityServerClients", x => x.Id); }); + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + migrationBuilder.CreateTable( name: "IdentityServerIdentityResources", columns: table => new @@ -366,25 +366,6 @@ protected override void Up(MigrationBuilder migrationBuilder) onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "AbpTenantConnectionStrings", - columns: table => new - { - TenantId = table.Column(nullable: false), - Name = table.Column(maxLength: 64, nullable: false), - Value = table.Column(maxLength: 1024, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); - table.ForeignKey( - name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", - column: x => x.TenantId, - principalTable: "AbpTenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "AbpUserClaims", columns: table => new @@ -817,11 +798,6 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "AbpSettings", columns: new[] { "Name", "ProviderName", "ProviderKey" }); - migrationBuilder.CreateIndex( - name: "IX_AbpTenants_Name", - table: "AbpTenants", - column: "Name"); - migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", table: "AbpUserClaims", @@ -862,6 +838,23 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "IdentityServerClients", column: "ClientId"); + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_Expiration", table: "IdentityServerPersistedGrants", @@ -893,9 +886,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "AbpSettings"); - migrationBuilder.DropTable( - name: "AbpTenantConnectionStrings"); - migrationBuilder.DropTable( name: "AbpUserClaims"); @@ -944,6 +934,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "IdentityServerClientSecrets"); + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + migrationBuilder.DropTable( name: "IdentityServerIdentityClaims"); @@ -953,9 +946,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "AbpEntityChanges"); - migrationBuilder.DropTable( - name: "AbpTenants"); - migrationBuilder.DropTable( name: "AbpRoles"); diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs index c79748f7f9a..81f7c5f23b5 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Migrations/AuthServerDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -424,6 +424,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -467,6 +468,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1109,6 +1111,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") diff --git a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs index aa1c36303ff..9fdd1dd8cdc 100644 --- a/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs +++ b/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/ProductManagementWebModule.cs @@ -6,7 +6,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; using Volo.Abp.Localization; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Validation.Localization; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; diff --git a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement/ProductManagementDomainTestBase.cs b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement/ProductManagementDomainTestBase.cs index 062c57b44b1..de73af7a375 100644 --- a/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement/ProductManagementDomainTestBase.cs +++ b/samples/MicroserviceDemo/modules/product/test/ProductManagement.Domain.Tests/ProductManagement/ProductManagementDomainTestBase.cs @@ -9,26 +9,6 @@ public abstract class ProductManagementDomainTestBase : ProductManagementTestBas { #region WithUnitOfWork - protected virtual void WithUnitOfWork(Action action) - { - WithUnitOfWork(new AbpUnitOfWorkOptions(), action); - } - - protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - action(); - - uow.Complete(); - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); @@ -49,26 +29,6 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F } } - protected virtual TResult WithUnitOfWork(Func func) - { - return WithUnitOfWork(new AbpUnitOfWorkOptions(), func); - } - - protected virtual TResult WithUnitOfWork(AbpUnitOfWorkOptions options, Func func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = func(); - uow.Complete(); - return result; - } - } - } - protected virtual Task WithUnitOfWorkAsync(Func> func) { return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); diff --git a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.Designer.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.Designer.cs similarity index 96% rename from samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.Designer.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.Designer.cs index 6d332272407..252d7d8c3dd 100644 --- a/samples/BookStore/src/Acme.BookStore.EntityFrameworkCore.DbMigrations/Migrations/20191018075950_Initial.Designer.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.Designer.cs @@ -1,23 +1,23 @@ // using System; -using Acme.BookStore.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using MyCompanyName.MyProjectName.EntityFrameworkCore; -namespace Acme.BookStore.Migrations +namespace MyCompanyName.MyProjectName.Migrations { - [DbContext(typeof(BookStoreMigrationsDbContext))] - [Migration("20191018075950_Initial")] + [DbContext(typeof(MyProjectNameMigrationsDbContext))] + [Migration("20200106080719_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -512,6 +512,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -555,6 +556,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1197,6 +1199,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") @@ -1453,8 +1519,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.cs similarity index 96% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.cs rename to templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.cs index c7b0e07a560..170372b3e01 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20200106080719_Initial.cs @@ -283,6 +283,27 @@ protected override void Up(MigrationBuilder migrationBuilder) table.PrimaryKey("PK_IdentityServerClients", x => x.Id); }); + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + migrationBuilder.CreateTable( name: "IdentityServerIdentityResources", columns: table => new @@ -908,6 +929,23 @@ protected override void Up(MigrationBuilder migrationBuilder) table: "IdentityServerClients", column: "ClientId"); + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_Expiration", table: "IdentityServerPersistedGrants", @@ -996,6 +1034,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "IdentityServerClientSecrets"); + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + migrationBuilder.DropTable( name: "IdentityServerIdentityClaims"); 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 460515931f7..9b3096b4bab 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 @@ -1197,6 +1197,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.Designer.cs similarity index 96% rename from templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.Designer.cs index 282d8490beb..d3c4fe12b3b 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.EntityFrameworkCore.DbMigrations/Migrations/20191218090017_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.Designer.cs @@ -9,8 +9,8 @@ namespace MyCompanyName.MyProjectName.Migrations { - [DbContext(typeof(MyProjectNameMigrationsDbContext))] - [Migration("20191218090017_Initial")] + [DbContext(typeof(IdentityServerHostMigrationsDbContext))] + [Migration("20200106080828_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -268,92 +268,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AbpEntityPropertyChanges"); }); - modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime2"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("IsAbandoned") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("JobArgs") - .IsRequired() - .HasColumnType("nvarchar(max)") - .HasMaxLength(1048576); - - b.Property("JobName") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("LastTryTime") - .HasColumnType("datetime2"); - - b.Property("NextTryTime") - .HasColumnType("datetime2"); - - b.Property("Priority") - .ValueGeneratedOnAdd() - .HasColumnType("tinyint") - .HasDefaultValue((byte)15); - - b.Property("TryCount") - .ValueGeneratedOnAdd() - .HasColumnType("smallint") - .HasDefaultValue((short)0); - - b.HasKey("Id"); - - b.HasIndex("IsAbandoned", "NextTryTime"); - - b.ToTable("AbpBackgroundJobs"); - }); - - modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("ProviderName") - .HasColumnType("nvarchar(64)") - .HasMaxLength(64); - - b.Property("Value") - .IsRequired() - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.HasKey("Id"); - - b.HasIndex("Name", "ProviderName", "ProviderKey"); - - b.ToTable("AbpFeatureValues"); - }); - modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") @@ -1199,6 +1113,70 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.cs new file mode 100644 index 00000000000..29cc3396eb8 --- /dev/null +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20200106080828_Initial.cs @@ -0,0 +1,1022 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace MyCompanyName.MyProjectName.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + ApplicationName = table.Column(maxLength: 96, nullable: true), + UserId = table.Column(nullable: true), + UserName = table.Column(maxLength: 256, nullable: true), + TenantId = table.Column(nullable: true), + TenantName = table.Column(nullable: true), + ImpersonatorUserId = table.Column(nullable: true), + ImpersonatorTenantId = table.Column(nullable: true), + ExecutionTime = table.Column(nullable: false), + ExecutionDuration = table.Column(nullable: false), + ClientIpAddress = table.Column(maxLength: 64, nullable: true), + ClientName = table.Column(maxLength: 128, nullable: true), + ClientId = table.Column(maxLength: 64, nullable: true), + CorrelationId = table.Column(maxLength: 64, nullable: true), + BrowserInfo = table.Column(maxLength: 512, nullable: true), + HttpMethod = table.Column(maxLength: 16, nullable: true), + Url = table.Column(maxLength: 256, nullable: true), + Exceptions = table.Column(maxLength: 4000, nullable: true), + Comments = table.Column(maxLength: 256, nullable: true), + HttpStatusCode = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), + Name = table.Column(maxLength: 256, nullable: false), + Required = table.Column(nullable: false), + IsStatic = table.Column(nullable: false), + Regex = table.Column(maxLength: 512, nullable: true), + RegexDescription = table.Column(maxLength: 128, nullable: true), + Description = table.Column(maxLength: 256, nullable: true), + ValueType = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + Name = table.Column(maxLength: 128, nullable: false), + ProviderName = table.Column(maxLength: 64, nullable: false), + ProviderKey = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 256, nullable: false), + TenantId = table.Column(nullable: true), + Name = table.Column(maxLength: 256, nullable: false), + NormalizedName = table.Column(maxLength: 256, nullable: false), + IsDefault = table.Column(nullable: false), + IsStatic = table.Column(nullable: false), + IsPublic = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(nullable: false), + Name = table.Column(maxLength: 128, nullable: false), + Value = table.Column(maxLength: 2048, nullable: false), + ProviderName = table.Column(maxLength: 64, nullable: true), + ProviderKey = table.Column(maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + Name = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + TenantId = table.Column(nullable: true), + UserName = table.Column(maxLength: 256, nullable: false), + NormalizedUserName = table.Column(maxLength: 256, nullable: false), + Name = table.Column(maxLength: 64, nullable: true), + Surname = table.Column(maxLength: 64, nullable: true), + Email = table.Column(maxLength: 256, nullable: false), + NormalizedEmail = table.Column(maxLength: 256, nullable: false), + EmailConfirmed = table.Column(nullable: false, defaultValue: false), + PasswordHash = table.Column(maxLength: 256, nullable: true), + SecurityStamp = table.Column(maxLength: 256, nullable: false), + PhoneNumber = table.Column(maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(nullable: false, defaultValue: false), + TwoFactorEnabled = table.Column(nullable: false, defaultValue: false), + LockoutEnd = table.Column(nullable: true), + LockoutEnabled = table.Column(nullable: false, defaultValue: false), + AccessFailedCount = table.Column(nullable: false, defaultValue: 0) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiResources", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + Enabled = table.Column(nullable: false), + Properties = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClients", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + ClientId = table.Column(maxLength: 200, nullable: false), + ClientName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + ClientUri = table.Column(maxLength: 2000, nullable: true), + LogoUri = table.Column(maxLength: 2000, nullable: true), + Enabled = table.Column(nullable: false), + ProtocolType = table.Column(maxLength: 200, nullable: false), + RequireClientSecret = table.Column(nullable: false), + RequireConsent = table.Column(nullable: false), + AllowRememberConsent = table.Column(nullable: false), + AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), + RequirePkce = table.Column(nullable: false), + AllowPlainTextPkce = table.Column(nullable: false), + AllowAccessTokensViaBrowser = table.Column(nullable: false), + FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + FrontChannelLogoutSessionRequired = table.Column(nullable: false), + BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + BackChannelLogoutSessionRequired = table.Column(nullable: false), + AllowOfflineAccess = table.Column(nullable: false), + IdentityTokenLifetime = table.Column(nullable: false), + AccessTokenLifetime = table.Column(nullable: false), + AuthorizationCodeLifetime = table.Column(nullable: false), + ConsentLifetime = table.Column(nullable: true), + AbsoluteRefreshTokenLifetime = table.Column(nullable: false), + SlidingRefreshTokenLifetime = table.Column(nullable: false), + RefreshTokenUsage = table.Column(nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false), + RefreshTokenExpiration = table.Column(nullable: false), + AccessTokenType = table.Column(nullable: false), + EnableLocalLogin = table.Column(nullable: false), + IncludeJwtId = table.Column(nullable: false), + AlwaysSendClientClaims = table.Column(nullable: false), + ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClients", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerDeviceFlowCodes", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityResources", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(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), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + 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) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerPersistedGrants", + columns: table => new + { + Key = table.Column(maxLength: 200, nullable: false), + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + Type = table.Column(maxLength: 50, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + CreationTime = table.Column(nullable: false), + Expiration = table.Column(nullable: true), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); + }); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + AuditLogId = table.Column(nullable: false), + ServiceName = table.Column(maxLength: 256, nullable: true), + MethodName = table.Column(maxLength: 128, nullable: true), + Parameters = table.Column(maxLength: 2000, nullable: true), + ExecutionTime = table.Column(nullable: false), + ExecutionDuration = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(nullable: false), + AuditLogId = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + ChangeTime = table.Column(nullable: false), + ChangeType = table.Column(nullable: false), + EntityTenantId = table.Column(nullable: true), + EntityId = table.Column(maxLength: 128, nullable: false), + EntityTypeFullName = table.Column(maxLength: 128, nullable: false), + ExtraProperties = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + ClaimType = table.Column(maxLength: 256, nullable: false), + ClaimValue = table.Column(maxLength: 1024, nullable: true), + RoleId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(nullable: false), + Name = table.Column(maxLength: 64, nullable: false), + Value = table.Column(maxLength: 1024, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + ClaimType = table.Column(maxLength: 256, nullable: false), + ClaimValue = table.Column(maxLength: 1024, nullable: true), + UserId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(nullable: false), + LoginProvider = table.Column(maxLength: 64, nullable: false), + TenantId = table.Column(nullable: true), + ProviderKey = table.Column(maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(nullable: false), + RoleId = table.Column(nullable: false), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(nullable: false), + LoginProvider = table.Column(maxLength: 64, nullable: false), + Name = table.Column(maxLength: 128, nullable: false), + TenantId = table.Column(nullable: true), + Value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiClaims", + columns: table => new + { + Type = table.Column(maxLength: 200, nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiScopes", + 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) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name }); + table.ForeignKey( + name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerApiSecrets", + 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), + Expiration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "IdentityServerApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientClaims", + columns: table => new + { + ClientId = table.Column(nullable: false), + Type = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientCorsOrigins", + columns: table => new + { + ClientId = table.Column(nullable: false), + Origin = table.Column(maxLength: 150, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); + table.ForeignKey( + name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientGrantTypes", + columns: table => new + { + ClientId = table.Column(nullable: false), + GrantType = table.Column(maxLength: 250, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); + table.ForeignKey( + name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientIdPRestrictions", + columns: table => new + { + ClientId = table.Column(nullable: false), + Provider = table.Column(maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); + table.ForeignKey( + name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientPostLogoutRedirectUris", + columns: table => new + { + ClientId = table.Column(nullable: false), + PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientProperties", + columns: table => new + { + ClientId = table.Column(nullable: false), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key }); + table.ForeignKey( + name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientRedirectUris", + columns: table => new + { + ClientId = table.Column(nullable: false), + RedirectUri = table.Column(maxLength: 2000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); + table.ForeignKey( + name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientScopes", + columns: table => new + { + ClientId = table.Column(nullable: false), + Scope = table.Column(maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); + table.ForeignKey( + name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerClientSecrets", + columns: table => new + { + Type = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 4000, nullable: false), + ClientId = table.Column(nullable: false), + Description = table.Column(maxLength: 2000, nullable: true), + Expiration = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); + table.ForeignKey( + name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", + column: x => x.ClientId, + principalTable: "IdentityServerClients", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityServerIdentityClaims", + columns: table => new + { + Type = table.Column(maxLength: 200, nullable: false), + IdentityResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type }); + table.ForeignKey( + name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityServerIdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + EntityChangeId = table.Column(nullable: false), + NewValue = table.Column(maxLength: 512, nullable: true), + OriginalValue = table.Column(maxLength: 512, nullable: true), + PropertyName = table.Column(maxLength: 128, nullable: false), + PropertyTypeFullName = table.Column(maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + 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", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "Name", "ProviderName", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerClients_ClientId", + table: "IdentityServerClients", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", + table: "IdentityServerDeviceFlowCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_Expiration", + table: "IdentityServerDeviceFlowCodes", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerDeviceFlowCodes_UserCode", + table: "IdentityServerDeviceFlowCodes", + column: "UserCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_Expiration", + table: "IdentityServerPersistedGrants", + column: "Expiration"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", + table: "IdentityServerPersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "IdentityServerApiClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopeClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerClientClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerClientCorsOrigins"); + + migrationBuilder.DropTable( + name: "IdentityServerClientGrantTypes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientIdPRestrictions"); + + migrationBuilder.DropTable( + name: "IdentityServerClientPostLogoutRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientProperties"); + + migrationBuilder.DropTable( + name: "IdentityServerClientRedirectUris"); + + migrationBuilder.DropTable( + name: "IdentityServerClientScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClientSecrets"); + + migrationBuilder.DropTable( + name: "IdentityServerDeviceFlowCodes"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityClaims"); + + migrationBuilder.DropTable( + name: "IdentityServerPersistedGrants"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "IdentityServerApiScopes"); + + migrationBuilder.DropTable( + name: "IdentityServerClients"); + + migrationBuilder.DropTable( + name: "IdentityServerIdentityResources"); + + 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 7e25b0e36a9..33aa2b4dedb 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 @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.0") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -424,6 +424,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("Email") + .IsRequired() .HasColumnName("Email") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -467,6 +468,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64); b.Property("NormalizedEmail") + .IsRequired() .HasColumnName("NormalizedEmail") .HasColumnType("nvarchar(256)") .HasMaxLength(256); @@ -1109,6 +1111,70 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityServerClientSecrets"); }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => { b.Property("Key") diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200106080643_Initial.Designer.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200106080643_Initial.Designer.cs index 5ce29ab888d..93e8a25a345 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200106080643_Initial.Designer.cs @@ -10,7 +10,7 @@ namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(UnifiedDbContext))] - [Migration("20191218090727_Initial")] + [Migration("20200106080643_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200106080643_Initial.cs similarity index 100% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20191218090727_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Migrations/20200106080643_Initial.cs