From 21fe6656f54189e2420044dfc5e64151bf22b261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 27 Nov 2019 15:55:36 +0300 Subject: [PATCH] Recreate the migration. --- ....Designer.cs => 20191127124541_Initial.Designer.cs} | 5 ++--- ...1018080944_Initial.cs => 20191127124541_Initial.cs} | 3 +-- ...entityServerHostMigrationsDbContextModelSnapshot.cs | 3 +-- .../MyCompanyName.MyProjectName.IdentityServer.csproj | 2 +- .../MyProjectNameIdentityServerModule.cs | 10 ++++++++-- 5 files changed, 13 insertions(+), 10 deletions(-) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/{20191018080944_Initial.Designer.cs => 20191127124541_Initial.Designer.cs} (99%) rename templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/{20191018080944_Initial.cs => 20191127124541_Initial.cs} (99%) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191018080944_Initial.Designer.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191018080944_Initial.Designer.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs index 3869a52615..0733f562cd 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191018080944_Initial.Designer.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.Designer.cs @@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.EntityFrameworkCore; namespace MyCompanyName.MyProjectName.Migrations { [DbContext(typeof(IdentityServerHostMigrationsDbContext))] - [Migration("20191018080944_Initial")] + [Migration("20191127124541_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -1367,8 +1367,7 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191018080944_Initial.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs similarity index 99% rename from templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191018080944_Initial.cs rename to templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs index cba4297cc9..217c00a646 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191018080944_Initial.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Migrations/20191127124541_Initial.cs @@ -820,8 +820,7 @@ namespace MyCompanyName.MyProjectName.Migrations migrationBuilder.CreateIndex( name: "IX_AbpTenants_Name", table: "AbpTenants", - column: "Name", - unique: true); + column: "Name"); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", 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 e4036868a3..7e25b0e36a 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 @@ -1365,8 +1365,7 @@ namespace MyCompanyName.MyProjectName.Migrations b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name"); b.ToTable("AbpTenants"); }); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj index ff138edc82..31287c43cd 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj @@ -17,7 +17,7 @@ - + diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 7179db5d08..541c7b8c07 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -10,8 +10,8 @@ using Swashbuckle.AspNetCore.Swagger; using Volo.Abp; using Volo.Abp.Account.Web; using Volo.Abp.AspNetCore.Authentication.JwtBearer; -using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; @@ -26,6 +26,7 @@ using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.HttpApi; @@ -40,7 +41,7 @@ namespace MyCompanyName.MyProjectName { [DependsOn( typeof(AbpAccountWebIdentityServerModule), - typeof(AbpAspNetCoreMultiTenancyModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), @@ -115,6 +116,11 @@ namespace MyCompanyName.MyProjectName options.KeyPrefix = "MyProjectName:"; }); + Configure(options => + { + options.IsEnabled = MultiTenancyConsts.IsEnabled; + }); + context.Services.AddStackExchangeRedisCache(options => { options.Configuration = configuration["Redis:Configuration"];