From dc576f8801e02683513059a97c0c781a3df0e067 Mon Sep 17 00:00:00 2001 From: Lee Richardson Date: Fri, 23 Oct 2020 16:34:13 -0400 Subject: [PATCH] Upgrade back-end template to 5.14 --- .../src/LeesStore.Core/AppVersionHelper.cs | 2 +- .../Localization/SourceFiles/LeesStore-tr.xml | 14 + .../Localization/SourceFiles/LeesStore.xml | 11 + .../Seed/Host/DefaultLanguagesCreator.cs | 2 +- ...0604091046_Upgraded_To_Abp_5_9.Designer.cs | 1824 +++++++++++++++++ .../20200604091046_Upgraded_To_Abp_5_9.cs | 33 + ...8141743_Upgraded_To_ABP_5_13_0.Designer.cs | 1824 +++++++++++++++++ .../20200928141743_Upgraded_To_ABP_5_13_0.cs | 255 +++ .../LeesStoreDbContextModelSnapshot.cs | 88 +- .../Models/TokenAuth/AuthenticateModel.cs | 4 +- .../src/LeesStore.Web.Host/Startup/Program.cs | 2 + .../src/LeesStore.Web.Host/Startup/Startup.cs | 30 +- .../src/LeesStore.Web.Host/appsettings.json | 7 + .../Controllers/HomeController_Tests.cs | 29 + .../LeesStore.Web.Tests.csproj | 30 + .../LeesStoreWebTestBase.cs | 216 ++ .../LeesStoreWebTestModule.cs | 38 + .../test/LeesStore.Web.Tests/Startup.cs | 86 + 18 files changed, 4443 insertions(+), 52 deletions(-) create mode 100644 aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.Designer.cs create mode 100644 aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.cs create mode 100644 aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.Designer.cs create mode 100644 aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.cs create mode 100644 aspnet-core/test/LeesStore.Web.Tests/Controllers/HomeController_Tests.cs create mode 100644 aspnet-core/test/LeesStore.Web.Tests/LeesStore.Web.Tests.csproj create mode 100644 aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestBase.cs create mode 100644 aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestModule.cs create mode 100644 aspnet-core/test/LeesStore.Web.Tests/Startup.cs diff --git a/aspnet-core/src/LeesStore.Core/AppVersionHelper.cs b/aspnet-core/src/LeesStore.Core/AppVersionHelper.cs index a8c680f..bd3f89b 100644 --- a/aspnet-core/src/LeesStore.Core/AppVersionHelper.cs +++ b/aspnet-core/src/LeesStore.Core/AppVersionHelper.cs @@ -13,7 +13,7 @@ public class AppVersionHelper /// Gets current version of the application. /// It's also shown in the web page. /// - public const string Version = "5.1.0.0"; + public const string Version = "5.5.0.0"; /// /// Gets release (last build) date of the application. diff --git a/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore-tr.xml b/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore-tr.xml index 540ee8d..0ba56c0 100644 --- a/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore-tr.xml +++ b/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore-tr.xml @@ -16,6 +16,8 @@ + + @@ -87,5 +89,17 @@ {0} rolü silinecek ve atanmış kullanıcılardan kaldırılacaktır. {0} müşterisi silinecektir. Ara... + Lütfen en az {0} karakter giriniz + Lütfen en fazla {0} karakter giriniz + Geçersiz e-posta adresi + Geçersiz + Eşleşmiyor + Hepsi + Toplam: {0} + Bul + Temizle + Mevcut şifreniz + Yeni şifre + Yeni şifreyi doğrula \ No newline at end of file diff --git a/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore.xml b/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore.xml index 2420e53..56063a9 100644 --- a/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore.xml +++ b/aspnet-core/src/LeesStore.Core/Localization/SourceFiles/LeesStore.xml @@ -105,5 +105,16 @@ Role {0} will be deleted and unassigned from all assigned users. Tenant {0} will be deleted. Search... + Please enter at least {0} characters + Please enter no more than {0} characters + Invalid email address + Invalid + Do not match + All + Total: {0} + Search + Clear + 1. Enter your administrator password + 2. Copy this random password so you can send it to the user diff --git a/aspnet-core/src/LeesStore.EntityFrameworkCore/EntityFrameworkCore/Seed/Host/DefaultLanguagesCreator.cs b/aspnet-core/src/LeesStore.EntityFrameworkCore/EntityFrameworkCore/Seed/Host/DefaultLanguagesCreator.cs index a48edc9..25dd257 100644 --- a/aspnet-core/src/LeesStore.EntityFrameworkCore/EntityFrameworkCore/Seed/Host/DefaultLanguagesCreator.cs +++ b/aspnet-core/src/LeesStore.EntityFrameworkCore/EntityFrameworkCore/Seed/Host/DefaultLanguagesCreator.cs @@ -17,7 +17,7 @@ private static List GetInitialLanguages() var tenantId = LeesStoreConsts.MultiTenancyEnabled ? null : (int?)MultiTenancyConsts.DefaultTenantId; return new List { - new ApplicationLanguage(tenantId, "en", "English", "famfamfam-flags gb"), + new ApplicationLanguage(tenantId, "en", "English", "famfamfam-flags us"), new ApplicationLanguage(tenantId, "ar", "العربية", "famfamfam-flags sa"), new ApplicationLanguage(tenantId, "de", "German", "famfamfam-flags de"), new ApplicationLanguage(tenantId, "it", "Italiano", "famfamfam-flags it"), diff --git a/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.Designer.cs b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.Designer.cs new file mode 100644 index 0000000..b4c0f63 --- /dev/null +++ b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.Designer.cs @@ -0,0 +1,1824 @@ +// +using System; +using LeesStore.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace LeesStore.Migrations +{ + [DbContext(typeof(LeesStoreDbContext))] + [Migration("20200604091046_Upgraded_To_Abp_5_9")] + partial class Upgraded_To_Abp_5_9 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Abp.Application.Editions.Edition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("AbpEditions"); + }); + + modelBuilder.Entity("Abp.Application.Features.FeatureSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.ToTable("AbpFeatures"); + + b.HasDiscriminator("Discriminator").HasValue("FeatureSetting"); + }); + + modelBuilder.Entity("Abp.Auditing.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CustomData") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Exception") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("int"); + + b.Property("ImpersonatorUserId") + .HasColumnType("bigint"); + + b.Property("MethodName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Parameters") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("ReturnValue") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionDuration"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Abp.Authorization.PermissionSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsGranted") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpPermissions"); + + b.HasDiscriminator("Discriminator").HasValue("PermissionSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("TenantId", "ClaimType"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("EmailAddress") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("UserLinkId") + .HasColumnType("bigint"); + + b.Property("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("EmailAddress"); + + b.HasIndex("UserName"); + + b.HasIndex("TenantId", "EmailAddress"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "UserName"); + + b.ToTable("AbpUserAccounts"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "ClaimType"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("LoginProvider") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserLoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Result") + .HasColumnType("tinyint"); + + b.Property("TenancyName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("UserNameOrEmailAddress") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("UserId", "TenantId"); + + b.HasIndex("TenancyName", "UserNameOrEmailAddress", "Result"); + + b.ToTable("AbpUserLoginAttempts"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserOrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrganizationUnitId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "OrganizationUnitId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "RoleId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Abp.BackgroundJobs.BackgroundJobInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("IsAbandoned") + .HasColumnType("bit"); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobType") + .IsRequired() + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .HasColumnType("tinyint"); + + b.Property("TryCount") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Abp.Configuration.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "Name", "UserId") + .IsUnique(); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.DynamicParameter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("InputType") + .HasColumnType("nvarchar(max)"); + + b.Property("ParameterName") + .HasColumnType("nvarchar(450)"); + + b.Property("Permission") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ParameterName", "TenantId") + .IsUnique() + .HasFilter("[ParameterName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicParameters"); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.DynamicParameterValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicParameterId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicParameterId"); + + b.ToTable("AbpDynamicParameterValues"); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameter", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicParameterId") + .HasColumnType("int"); + + b.Property("EntityFullName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DynamicParameterId"); + + b.HasIndex("EntityFullName", "DynamicParameterId", "TenantId") + .IsUnique() + .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpEntityDynamicParameters"); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameterValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("EntityDynamicParameterId") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("EntityDynamicParameterId"); + + b.ToTable("AbpEntityDynamicParameterValues"); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityChangeSetId") + .HasColumnType("bigint"); + + b.Property("EntityId") + .HasColumnType("nvarchar(48)") + .HasMaxLength(48); + + b.Property("EntityTypeFullName") + .HasColumnType("nvarchar(192)") + .HasMaxLength(192); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeSetId"); + + b.HasIndex("EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityChangeSet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtensionData") + .HasColumnType("nvarchar(max)"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("int"); + + b.Property("ImpersonatorUserId") + .HasColumnType("bigint"); + + b.Property("Reason") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "CreationTime"); + + b.HasIndex("TenantId", "Reason"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpEntityChangeSets"); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("EntityChangeId") + .HasColumnType("bigint"); + + b.Property("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("PropertyTypeFullName") + .HasColumnType("nvarchar(192)") + .HasMaxLength(192); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Abp.Localization.ApplicationLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Icon") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsDisabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpLanguages"); + }); + + modelBuilder.Entity("Abp.Localization.ApplicationLanguageText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("LanguageName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Source") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(67108864); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Source", "LanguageName", "Key"); + + b.ToTable("AbpLanguageTexts"); + }); + + modelBuilder.Entity("Abp.Notifications.NotificationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Data") + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("DataTypeName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityId") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("EntityTypeAssemblyQualifiedName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityTypeName") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("ExcludedUserIds") + .HasColumnType("nvarchar(max)") + .HasMaxLength(131072); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantIds") + .HasColumnType("nvarchar(max)") + .HasMaxLength(131072); + + b.Property("UserIds") + .HasColumnType("nvarchar(max)") + .HasMaxLength(131072); + + b.HasKey("Id"); + + b.ToTable("AbpNotifications"); + }); + + modelBuilder.Entity("Abp.Notifications.NotificationSubscriptionInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("EntityId") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("EntityTypeAssemblyQualifiedName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityTypeName") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("NotificationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("NotificationName", "EntityTypeName", "EntityId", "UserId"); + + b.HasIndex("TenantId", "NotificationName", "EntityTypeName", "EntityId", "UserId"); + + b.ToTable("AbpNotificationSubscriptions"); + }); + + modelBuilder.Entity("Abp.Notifications.TenantNotificationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Data") + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("DataTypeName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityId") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("EntityTypeAssemblyQualifiedName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityTypeName") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("AbpTenantNotifications"); + }); + + modelBuilder.Entity("Abp.Notifications.UserNotificationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("TenantNotificationId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "State", "CreationTime"); + + b.ToTable("AbpUserNotifications"); + }); + + modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code") + .IsRequired() + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("TenantId", "Code"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Abp.Organizations.OrganizationUnitRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrganizationUnitId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "OrganizationUnitId"); + + b.HasIndex("TenantId", "RoleId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .HasColumnType("nvarchar(max)"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("WebhookName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhookEvents"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookSendAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("Response") + .HasColumnType("nvarchar(max)"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("WebhookEventId") + .HasColumnType("uniqueidentifier"); + + b.Property("WebhookSubscriptionId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("WebhookEventId"); + + b.ToTable("AbpWebhookSendAttempts"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookSubscriptionInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Headers") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("Secret") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("WebhookUri") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Webhooks") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhookSubscriptions"); + }); + + modelBuilder.Entity("LeesStore.Authorization.Roles.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)") + .HasMaxLength(5000); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreatorUserId"); + + b.HasIndex("DeleterUserId"); + + b.HasIndex("LastModifierUserId"); + + b.HasIndex("TenantId", "NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("LeesStore.Authorization.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AuthenticationSource") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmationCode") + .HasColumnType("nvarchar(328)") + .HasMaxLength(328); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsEmailConfirmed") + .HasColumnType("bit"); + + b.Property("IsLockoutEnabled") + .HasColumnType("bit"); + + b.Property("IsPhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("IsTwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("LockoutEndDateUtc") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmailAddress") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PasswordResetCode") + .HasColumnType("nvarchar(328)") + .HasMaxLength(328); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Surname") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("CreatorUserId"); + + b.HasIndex("DeleterUserId"); + + b.HasIndex("LastModifierUserId"); + + b.HasIndex("TenantId", "NormalizedEmailAddress"); + + b.HasIndex("TenantId", "NormalizedUserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("LeesStore.MultiTenancy.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ConnectionString") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("EditionId") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenancyName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("CreatorUserId"); + + b.HasIndex("DeleterUserId"); + + b.HasIndex("EditionId"); + + b.HasIndex("LastModifierUserId"); + + b.HasIndex("TenancyName"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => + { + b.HasBaseType("Abp.Application.Features.FeatureSetting"); + + b.Property("EditionId") + .HasColumnType("int"); + + b.HasIndex("EditionId", "Name"); + + b.ToTable("AbpFeatures"); + + b.HasDiscriminator().HasValue("EditionFeatureSetting"); + }); + + modelBuilder.Entity("Abp.MultiTenancy.TenantFeatureSetting", b => + { + b.HasBaseType("Abp.Application.Features.FeatureSetting"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpFeatures"); + + b.HasDiscriminator().HasValue("TenantFeatureSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => + { + b.HasBaseType("Abp.Authorization.PermissionSetting"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpPermissions"); + + b.HasDiscriminator().HasValue("RolePermissionSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => + { + b.HasBaseType("Abp.Authorization.PermissionSetting"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasIndex("UserId"); + + b.ToTable("AbpPermissions"); + + b.HasDiscriminator().HasValue("UserPermissionSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => + { + b.HasOne("LeesStore.Authorization.Roles.Role", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Configuration.Setting", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Settings") + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.DynamicParameterValue", b => + { + b.HasOne("Abp.DynamicEntityParameters.DynamicParameter", "DynamicParameter") + .WithMany("DynamicParameterValues") + .HasForeignKey("DynamicParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameter", b => + { + b.HasOne("Abp.DynamicEntityParameters.DynamicParameter", "DynamicParameter") + .WithMany() + .HasForeignKey("DynamicParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameterValue", b => + { + b.HasOne("Abp.DynamicEntityParameters.EntityDynamicParameter", "EntityDynamicParameter") + .WithMany() + .HasForeignKey("EntityDynamicParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => + { + b.HasOne("Abp.EntityHistory.EntityChangeSet", null) + .WithMany("EntityChanges") + .HasForeignKey("EntityChangeSetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => + { + b.HasOne("Abp.EntityHistory.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => + { + b.HasOne("Abp.Organizations.OrganizationUnit", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookSendAttempt", b => + { + b.HasOne("Abp.Webhooks.WebhookEvent", "WebhookEvent") + .WithMany() + .HasForeignKey("WebhookEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LeesStore.Authorization.Roles.Role", b => + { + b.HasOne("LeesStore.Authorization.Users.User", "CreatorUser") + .WithMany() + .HasForeignKey("CreatorUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "DeleterUser") + .WithMany() + .HasForeignKey("DeleterUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "LastModifierUser") + .WithMany() + .HasForeignKey("LastModifierUserId"); + }); + + modelBuilder.Entity("LeesStore.Authorization.Users.User", b => + { + b.HasOne("LeesStore.Authorization.Users.User", "CreatorUser") + .WithMany() + .HasForeignKey("CreatorUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "DeleterUser") + .WithMany() + .HasForeignKey("DeleterUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "LastModifierUser") + .WithMany() + .HasForeignKey("LastModifierUserId"); + }); + + modelBuilder.Entity("LeesStore.MultiTenancy.Tenant", b => + { + b.HasOne("LeesStore.Authorization.Users.User", "CreatorUser") + .WithMany() + .HasForeignKey("CreatorUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "DeleterUser") + .WithMany() + .HasForeignKey("DeleterUserId"); + + b.HasOne("Abp.Application.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId"); + + b.HasOne("LeesStore.Authorization.Users.User", "LastModifierUser") + .WithMany() + .HasForeignKey("LastModifierUserId"); + }); + + modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => + { + b.HasOne("Abp.Application.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => + { + b.HasOne("LeesStore.Authorization.Roles.Role", null) + .WithMany("Permissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Permissions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.cs b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.cs new file mode 100644 index 0000000..e523d7e --- /dev/null +++ b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200604091046_Upgraded_To_Abp_5_9.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LeesStore.Migrations +{ + public partial class Upgraded_To_Abp_5_9 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AbpOrganizationUnits_TenantId_Code", + table: "AbpOrganizationUnits"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_TenantId_Code", + table: "AbpOrganizationUnits", + columns: new[] { "TenantId", "Code" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AbpOrganizationUnits_TenantId_Code", + table: "AbpOrganizationUnits"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_TenantId_Code", + table: "AbpOrganizationUnits", + columns: new[] { "TenantId", "Code" }, + unique: true, + filter: "[TenantId] IS NOT NULL"); + } + } +} diff --git a/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.Designer.cs b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.Designer.cs new file mode 100644 index 0000000..690f3ba --- /dev/null +++ b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.Designer.cs @@ -0,0 +1,1824 @@ +// +using System; +using LeesStore.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace LeesStore.Migrations +{ + [DbContext(typeof(LeesStoreDbContext))] + [Migration("20200928141743_Upgraded_To_ABP_5_13_0")] + partial class Upgraded_To_ABP_5_13_0 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Abp.Application.Editions.Edition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("AbpEditions"); + }); + + modelBuilder.Entity("Abp.Application.Features.FeatureSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.ToTable("AbpFeatures"); + + b.HasDiscriminator("Discriminator").HasValue("FeatureSetting"); + }); + + modelBuilder.Entity("Abp.Auditing.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CustomData") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Exception") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("int"); + + b.Property("ImpersonatorUserId") + .HasColumnType("bigint"); + + b.Property("MethodName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Parameters") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("ReturnValue") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionDuration"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Abp.Authorization.PermissionSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsGranted") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpPermissions"); + + b.HasDiscriminator("Discriminator").HasValue("PermissionSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("TenantId", "ClaimType"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("EmailAddress") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("UserLinkId") + .HasColumnType("bigint"); + + b.Property("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("EmailAddress"); + + b.HasIndex("UserName"); + + b.HasIndex("TenantId", "EmailAddress"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "UserName"); + + b.ToTable("AbpUserAccounts"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClaimType") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "ClaimType"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("LoginProvider") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "UserId"); + + b.HasIndex("TenantId", "LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserLoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Result") + .HasColumnType("tinyint"); + + b.Property("TenancyName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("UserNameOrEmailAddress") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("UserId", "TenantId"); + + b.HasIndex("TenancyName", "UserNameOrEmailAddress", "Result"); + + b.ToTable("AbpUserLoginAttempts"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserOrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrganizationUnitId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "OrganizationUnitId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "RoleId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ExpireDate") + .HasColumnType("datetime2"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Abp.BackgroundJobs.BackgroundJobInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("IsAbandoned") + .HasColumnType("bit"); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobType") + .IsRequired() + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .HasColumnType("tinyint"); + + b.Property("TryCount") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Abp.Configuration.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("TenantId", "Name", "UserId") + .IsUnique(); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicPropertyId") + .HasColumnType("int"); + + b.Property("EntityFullName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DynamicPropertyId"); + + b.HasIndex("EntityFullName", "DynamicPropertyId", "TenantId") + .IsUnique() + .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicEntityProperties"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicEntityPropertyId") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicEntityPropertyId"); + + b.ToTable("AbpDynamicEntityPropertyValues"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("InputType") + .HasColumnType("nvarchar(max)"); + + b.Property("Permission") + .HasColumnType("nvarchar(max)"); + + b.Property("PropertyName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PropertyName", "TenantId") + .IsUnique() + .HasFilter("[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicProperties"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicPropertyId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicPropertyId"); + + b.ToTable("AbpDynamicPropertyValues"); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityChangeSetId") + .HasColumnType("bigint"); + + b.Property("EntityId") + .HasColumnType("nvarchar(48)") + .HasMaxLength(48); + + b.Property("EntityTypeFullName") + .HasColumnType("nvarchar(192)") + .HasMaxLength(192); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeSetId"); + + b.HasIndex("EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityChangeSet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtensionData") + .HasColumnType("nvarchar(max)"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("int"); + + b.Property("ImpersonatorUserId") + .HasColumnType("bigint"); + + b.Property("Reason") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "CreationTime"); + + b.HasIndex("TenantId", "Reason"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpEntityChangeSets"); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("EntityChangeId") + .HasColumnType("bigint"); + + b.Property("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("PropertyTypeFullName") + .HasColumnType("nvarchar(192)") + .HasMaxLength(192); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Abp.Localization.ApplicationLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Icon") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsDisabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpLanguages"); + }); + + modelBuilder.Entity("Abp.Localization.ApplicationLanguageText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("LanguageName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Source") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(67108864); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Source", "LanguageName", "Key"); + + b.ToTable("AbpLanguageTexts"); + }); + + modelBuilder.Entity("Abp.Notifications.NotificationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Data") + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("DataTypeName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityId") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("EntityTypeAssemblyQualifiedName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityTypeName") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("ExcludedUserIds") + .HasColumnType("nvarchar(max)") + .HasMaxLength(131072); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantIds") + .HasColumnType("nvarchar(max)") + .HasMaxLength(131072); + + b.Property("UserIds") + .HasColumnType("nvarchar(max)") + .HasMaxLength(131072); + + b.HasKey("Id"); + + b.ToTable("AbpNotifications"); + }); + + modelBuilder.Entity("Abp.Notifications.NotificationSubscriptionInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("EntityId") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("EntityTypeAssemblyQualifiedName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityTypeName") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("NotificationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("NotificationName", "EntityTypeName", "EntityId", "UserId"); + + b.HasIndex("TenantId", "NotificationName", "EntityTypeName", "EntityId", "UserId"); + + b.ToTable("AbpNotificationSubscriptions"); + }); + + modelBuilder.Entity("Abp.Notifications.TenantNotificationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Data") + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("DataTypeName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityId") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("EntityTypeAssemblyQualifiedName") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("EntityTypeName") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("AbpTenantNotifications"); + }); + + modelBuilder.Entity("Abp.Notifications.UserNotificationInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("TenantNotificationId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "State", "CreationTime"); + + b.ToTable("AbpUserNotifications"); + }); + + modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Code") + .IsRequired() + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("TenantId", "Code"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Abp.Organizations.OrganizationUnitRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("OrganizationUnitId") + .HasColumnType("bigint"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "OrganizationUnitId"); + + b.HasIndex("TenantId", "RoleId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .HasColumnType("nvarchar(max)"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("WebhookName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhookEvents"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookSendAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("Response") + .HasColumnType("nvarchar(max)"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("WebhookEventId") + .HasColumnType("uniqueidentifier"); + + b.Property("WebhookSubscriptionId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("WebhookEventId"); + + b.ToTable("AbpWebhookSendAttempts"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookSubscriptionInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("Headers") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("Secret") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("WebhookUri") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Webhooks") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhookSubscriptions"); + }); + + modelBuilder.Entity("LeesStore.Authorization.Roles.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)") + .HasMaxLength(5000); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CreatorUserId"); + + b.HasIndex("DeleterUserId"); + + b.HasIndex("LastModifierUserId"); + + b.HasIndex("TenantId", "NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("LeesStore.Authorization.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("AuthenticationSource") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmationCode") + .HasColumnType("nvarchar(328)") + .HasMaxLength(328); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsEmailConfirmed") + .HasColumnType("bit"); + + b.Property("IsLockoutEnabled") + .HasColumnType("bit"); + + b.Property("IsPhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("IsTwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("LockoutEndDateUtc") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmailAddress") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PasswordResetCode") + .HasColumnType("nvarchar(328)") + .HasMaxLength(328); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(32)") + .HasMaxLength(32); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Surname") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("CreatorUserId"); + + b.HasIndex("DeleterUserId"); + + b.HasIndex("LastModifierUserId"); + + b.HasIndex("TenantId", "NormalizedEmailAddress"); + + b.HasIndex("TenantId", "NormalizedUserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("LeesStore.MultiTenancy.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ConnectionString") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorUserId") + .HasColumnType("bigint"); + + b.Property("DeleterUserId") + .HasColumnType("bigint"); + + b.Property("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("EditionId") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierUserId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenancyName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("CreatorUserId"); + + b.HasIndex("DeleterUserId"); + + b.HasIndex("EditionId"); + + b.HasIndex("LastModifierUserId"); + + b.HasIndex("TenancyName"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => + { + b.HasBaseType("Abp.Application.Features.FeatureSetting"); + + b.Property("EditionId") + .HasColumnType("int"); + + b.HasIndex("EditionId", "Name"); + + b.ToTable("AbpFeatures"); + + b.HasDiscriminator().HasValue("EditionFeatureSetting"); + }); + + modelBuilder.Entity("Abp.MultiTenancy.TenantFeatureSetting", b => + { + b.HasBaseType("Abp.Application.Features.FeatureSetting"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpFeatures"); + + b.HasDiscriminator().HasValue("TenantFeatureSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => + { + b.HasBaseType("Abp.Authorization.PermissionSetting"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpPermissions"); + + b.HasDiscriminator().HasValue("RolePermissionSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => + { + b.HasBaseType("Abp.Authorization.PermissionSetting"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasIndex("UserId"); + + b.ToTable("AbpPermissions"); + + b.HasDiscriminator().HasValue("UserPermissionSetting"); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => + { + b.HasOne("LeesStore.Authorization.Roles.Role", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Configuration.Setting", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Settings") + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany() + .HasForeignKey("DynamicPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicEntityProperty", "DynamicEntityProperty") + .WithMany() + .HasForeignKey("DynamicEntityPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany("DynamicPropertyValues") + .HasForeignKey("DynamicPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => + { + b.HasOne("Abp.EntityHistory.EntityChangeSet", null) + .WithMany("EntityChanges") + .HasForeignKey("EntityChangeSetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => + { + b.HasOne("Abp.EntityHistory.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => + { + b.HasOne("Abp.Organizations.OrganizationUnit", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Abp.Webhooks.WebhookSendAttempt", b => + { + b.HasOne("Abp.Webhooks.WebhookEvent", "WebhookEvent") + .WithMany() + .HasForeignKey("WebhookEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LeesStore.Authorization.Roles.Role", b => + { + b.HasOne("LeesStore.Authorization.Users.User", "CreatorUser") + .WithMany() + .HasForeignKey("CreatorUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "DeleterUser") + .WithMany() + .HasForeignKey("DeleterUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "LastModifierUser") + .WithMany() + .HasForeignKey("LastModifierUserId"); + }); + + modelBuilder.Entity("LeesStore.Authorization.Users.User", b => + { + b.HasOne("LeesStore.Authorization.Users.User", "CreatorUser") + .WithMany() + .HasForeignKey("CreatorUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "DeleterUser") + .WithMany() + .HasForeignKey("DeleterUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "LastModifierUser") + .WithMany() + .HasForeignKey("LastModifierUserId"); + }); + + modelBuilder.Entity("LeesStore.MultiTenancy.Tenant", b => + { + b.HasOne("LeesStore.Authorization.Users.User", "CreatorUser") + .WithMany() + .HasForeignKey("CreatorUserId"); + + b.HasOne("LeesStore.Authorization.Users.User", "DeleterUser") + .WithMany() + .HasForeignKey("DeleterUserId"); + + b.HasOne("Abp.Application.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId"); + + b.HasOne("LeesStore.Authorization.Users.User", "LastModifierUser") + .WithMany() + .HasForeignKey("LastModifierUserId"); + }); + + modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => + { + b.HasOne("Abp.Application.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => + { + b.HasOne("LeesStore.Authorization.Roles.Role", null) + .WithMany("Permissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => + { + b.HasOne("LeesStore.Authorization.Users.User", null) + .WithMany("Permissions") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.cs b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.cs new file mode 100644 index 0000000..19733d8 --- /dev/null +++ b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/20200928141743_Upgraded_To_ABP_5_13_0.cs @@ -0,0 +1,255 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LeesStore.Migrations +{ + public partial class Upgraded_To_ABP_5_13_0 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpDynamicParameterValues"); + + migrationBuilder.DropTable( + name: "AbpEntityDynamicParameterValues"); + + migrationBuilder.DropTable( + name: "AbpEntityDynamicParameters"); + + migrationBuilder.DropTable( + name: "AbpDynamicParameters"); + + migrationBuilder.CreateTable( + name: "AbpDynamicProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + PropertyName = table.Column(nullable: true), + InputType = table.Column(nullable: true), + Permission = table.Column(nullable: true), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicProperties", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpDynamicEntityProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + EntityFullName = table.Column(nullable: true), + DynamicPropertyId = table.Column(nullable: false), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicEntityProperties", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicEntityProperties_AbpDynamicProperties_DynamicPropertyId", + column: x => x.DynamicPropertyId, + principalTable: "AbpDynamicProperties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpDynamicPropertyValues", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Value = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + DynamicPropertyId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicPropertyValues", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicPropertyValues_AbpDynamicProperties_DynamicPropertyId", + column: x => x.DynamicPropertyId, + principalTable: "AbpDynamicProperties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpDynamicEntityPropertyValues", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Value = table.Column(nullable: false), + EntityId = table.Column(nullable: true), + DynamicEntityPropertyId = table.Column(nullable: false), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicEntityPropertyValues", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicEntityPropertyValues_AbpDynamicEntityProperties_DynamicEntityPropertyId", + column: x => x.DynamicEntityPropertyId, + principalTable: "AbpDynamicEntityProperties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicEntityProperties_DynamicPropertyId", + table: "AbpDynamicEntityProperties", + column: "DynamicPropertyId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicEntityProperties_EntityFullName_DynamicPropertyId_TenantId", + table: "AbpDynamicEntityProperties", + columns: new[] { "EntityFullName", "DynamicPropertyId", "TenantId" }, + unique: true, + filter: "[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicEntityPropertyValues_DynamicEntityPropertyId", + table: "AbpDynamicEntityPropertyValues", + column: "DynamicEntityPropertyId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicProperties_PropertyName_TenantId", + table: "AbpDynamicProperties", + columns: new[] { "PropertyName", "TenantId" }, + unique: true, + filter: "[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicPropertyValues_DynamicPropertyId", + table: "AbpDynamicPropertyValues", + column: "DynamicPropertyId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpDynamicEntityPropertyValues"); + + migrationBuilder.DropTable( + name: "AbpDynamicPropertyValues"); + + migrationBuilder.DropTable( + name: "AbpDynamicEntityProperties"); + + migrationBuilder.DropTable( + name: "AbpDynamicProperties"); + + migrationBuilder.CreateTable( + name: "AbpDynamicParameters", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + InputType = table.Column(type: "nvarchar(max)", nullable: true), + ParameterName = table.Column(type: "nvarchar(450)", nullable: true), + Permission = table.Column(type: "nvarchar(max)", nullable: true), + TenantId = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicParameters", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpDynamicParameterValues", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + DynamicParameterId = table.Column(type: "int", nullable: false), + TenantId = table.Column(type: "int", nullable: true), + Value = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicParameterValues", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicParameterValues_AbpDynamicParameters_DynamicParameterId", + column: x => x.DynamicParameterId, + principalTable: "AbpDynamicParameters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityDynamicParameters", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + DynamicParameterId = table.Column(type: "int", nullable: false), + EntityFullName = table.Column(type: "nvarchar(450)", nullable: true), + TenantId = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityDynamicParameters", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityDynamicParameters_AbpDynamicParameters_DynamicParameterId", + column: x => x.DynamicParameterId, + principalTable: "AbpDynamicParameters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityDynamicParameterValues", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + EntityDynamicParameterId = table.Column(type: "int", nullable: false), + EntityId = table.Column(type: "nvarchar(max)", nullable: true), + TenantId = table.Column(type: "int", nullable: true), + Value = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityDynamicParameterValues", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityDynamicParameterValues_AbpEntityDynamicParameters_EntityDynamicParameterId", + column: x => x.EntityDynamicParameterId, + principalTable: "AbpEntityDynamicParameters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicParameters_ParameterName_TenantId", + table: "AbpDynamicParameters", + columns: new[] { "ParameterName", "TenantId" }, + unique: true, + filter: "[ParameterName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicParameterValues_DynamicParameterId", + table: "AbpDynamicParameterValues", + column: "DynamicParameterId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityDynamicParameters_DynamicParameterId", + table: "AbpEntityDynamicParameters", + column: "DynamicParameterId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityDynamicParameters_EntityFullName_DynamicParameterId_TenantId", + table: "AbpEntityDynamicParameters", + columns: new[] { "EntityFullName", "DynamicParameterId", "TenantId" }, + unique: true, + filter: "[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityDynamicParameterValues_EntityDynamicParameterId", + table: "AbpEntityDynamicParameterValues", + column: "EntityDynamicParameterId"); + } + } +} diff --git a/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/LeesStoreDbContextModelSnapshot.cs b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/LeesStoreDbContextModelSnapshot.cs index ef9371d..47634af 100644 --- a/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/LeesStoreDbContextModelSnapshot.cs +++ b/aspnet-core/src/LeesStore.EntityFrameworkCore/Migrations/LeesStoreDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("ProductVersion", "3.1.5") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -611,44 +611,46 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AbpSettings"); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.DynamicParameter", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("InputType") - .HasColumnType("nvarchar(max)"); + b.Property("DynamicPropertyId") + .HasColumnType("int"); - b.Property("ParameterName") + b.Property("EntityFullName") .HasColumnType("nvarchar(450)"); - b.Property("Permission") - .HasColumnType("nvarchar(max)"); - b.Property("TenantId") .HasColumnType("int"); b.HasKey("Id"); - b.HasIndex("ParameterName", "TenantId") + b.HasIndex("DynamicPropertyId"); + + b.HasIndex("EntityFullName", "DynamicPropertyId", "TenantId") .IsUnique() - .HasFilter("[ParameterName] IS NOT NULL AND [TenantId] IS NOT NULL"); + .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); - b.ToTable("AbpDynamicParameters"); + b.ToTable("AbpDynamicEntityProperties"); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.DynamicParameterValue", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("DynamicParameterId") + b.Property("DynamicEntityPropertyId") .HasColumnType("int"); + b.Property("EntityId") + .HasColumnType("nvarchar(max)"); + b.Property("TenantId") .HasColumnType("int"); @@ -658,22 +660,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("DynamicParameterId"); + b.HasIndex("DynamicEntityPropertyId"); - b.ToTable("AbpDynamicParameterValues"); + b.ToTable("AbpDynamicEntityPropertyValues"); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameter", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("DynamicParameterId") - .HasColumnType("int"); + b.Property("InputType") + .HasColumnType("nvarchar(max)"); - b.Property("EntityFullName") + b.Property("Permission") + .HasColumnType("nvarchar(max)"); + + b.Property("PropertyName") .HasColumnType("nvarchar(450)"); b.Property("TenantId") @@ -681,28 +686,23 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("DynamicParameterId"); - - b.HasIndex("EntityFullName", "DynamicParameterId", "TenantId") + b.HasIndex("PropertyName", "TenantId") .IsUnique() - .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + .HasFilter("[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); - b.ToTable("AbpEntityDynamicParameters"); + b.ToTable("AbpDynamicProperties"); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameterValue", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("EntityDynamicParameterId") + b.Property("DynamicPropertyId") .HasColumnType("int"); - b.Property("EntityId") - .HasColumnType("nvarchar(max)"); - b.Property("TenantId") .HasColumnType("int"); @@ -712,9 +712,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("EntityDynamicParameterId"); + b.HasIndex("DynamicPropertyId"); - b.ToTable("AbpEntityDynamicParameterValues"); + b.ToTable("AbpDynamicPropertyValues"); }); modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => @@ -1171,9 +1171,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParentId"); - b.HasIndex("TenantId", "Code") - .IsUnique() - .HasFilter("[TenantId] IS NOT NULL"); + b.HasIndex("TenantId", "Code"); b.ToTable("AbpOrganizationUnits"); }); @@ -1682,29 +1680,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasForeignKey("UserId"); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.DynamicParameterValue", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => { - b.HasOne("Abp.DynamicEntityParameters.DynamicParameter", "DynamicParameter") - .WithMany("DynamicParameterValues") - .HasForeignKey("DynamicParameterId") + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany() + .HasForeignKey("DynamicPropertyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameter", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => { - b.HasOne("Abp.DynamicEntityParameters.DynamicParameter", "DynamicParameter") + b.HasOne("Abp.DynamicEntityProperties.DynamicEntityProperty", "DynamicEntityProperty") .WithMany() - .HasForeignKey("DynamicParameterId") + .HasForeignKey("DynamicEntityPropertyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Abp.DynamicEntityParameters.EntityDynamicParameterValue", b => + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => { - b.HasOne("Abp.DynamicEntityParameters.EntityDynamicParameter", "EntityDynamicParameter") - .WithMany() - .HasForeignKey("EntityDynamicParameterId") + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany("DynamicPropertyValues") + .HasForeignKey("DynamicPropertyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); diff --git a/aspnet-core/src/LeesStore.Web.Core/Models/TokenAuth/AuthenticateModel.cs b/aspnet-core/src/LeesStore.Web.Core/Models/TokenAuth/AuthenticateModel.cs index a00189e..91785f9 100644 --- a/aspnet-core/src/LeesStore.Web.Core/Models/TokenAuth/AuthenticateModel.cs +++ b/aspnet-core/src/LeesStore.Web.Core/Models/TokenAuth/AuthenticateModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Abp.Auditing; using Abp.Authorization.Users; namespace LeesStore.Models.TokenAuth @@ -11,8 +12,9 @@ public class AuthenticateModel [Required] [StringLength(AbpUserBase.MaxPlainPasswordLength)] + [DisableAuditing] public string Password { get; set; } - + public bool RememberClient { get; set; } } } diff --git a/aspnet-core/src/LeesStore.Web.Host/Startup/Program.cs b/aspnet-core/src/LeesStore.Web.Host/Startup/Program.cs index 0793e02..7313460 100644 --- a/aspnet-core/src/LeesStore.Web.Host/Startup/Program.cs +++ b/aspnet-core/src/LeesStore.Web.Host/Startup/Program.cs @@ -1,5 +1,7 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using System.IO; namespace LeesStore.Web.Host.Startup { diff --git a/aspnet-core/src/LeesStore.Web.Host/Startup/Startup.cs b/aspnet-core/src/LeesStore.Web.Host/Startup/Startup.cs index 1210284..f9d69fa 100644 --- a/aspnet-core/src/LeesStore.Web.Host/Startup/Startup.cs +++ b/aspnet-core/src/LeesStore.Web.Host/Startup/Startup.cs @@ -25,6 +25,8 @@ public class Startup { private const string _defaultCorsPolicyName = "localhost"; + private const string _apiVersion = "v1"; + private readonly IConfigurationRoot _appConfiguration; public Startup(IWebHostEnvironment env) @@ -76,7 +78,24 @@ public IServiceProvider ConfigureServices(IServiceCollection services) // Swagger - Enable this line and the related lines in Configure method to enable swagger UI services.AddSwaggerGen(options => { - options.SwaggerDoc("v1", new OpenApiInfo() { Title = "LeesStore API", Version = "v1" }); + options.SwaggerDoc(_apiVersion, new OpenApiInfo + { + Version = _apiVersion, + Title = "LeesStore API", + Description = "LeesStore", + // uncomment if needed TermsOfService = new Uri("https://example.com/terms"), + Contact = new OpenApiContact + { + Name = "LeesStore", + Email = string.Empty, + Url = new Uri("https://twitter.com/aspboilerplate"), + }, + License = new OpenApiLicense + { + Name = "MIT License", + Url = new Uri("https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/LICENSE"), + } + }); options.DocInclusionPredicate((docName, description) => true); // Define the BearerAuth scheme that's in use @@ -119,15 +138,18 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}"); }); - + // Enable middleware to serve generated Swagger as a JSON endpoint - app.UseSwagger(); + app.UseSwagger(c => { c.RouteTemplate = "swagger/{documentName}/swagger.json"; }); + // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.) app.UseSwaggerUI(options => { - options.SwaggerEndpoint(_appConfiguration["App:ServerRootAddress"].EnsureEndsWith('/') + "swagger/v1/swagger.json", "LeesStore API V1"); + // specifying the Swagger JSON endpoint. + options.SwaggerEndpoint($"/swagger/{_apiVersion}/swagger.json", $"LeesStore API {_apiVersion}"); options.IndexStream = () => Assembly.GetExecutingAssembly() .GetManifestResourceStream("LeesStore.Web.Host.wwwroot.swagger.ui.index.html"); + options.DisplayRequestDuration(); // Controls the display of the request duration (in milliseconds) for "Try it out" requests. }); // URL: /swagger } } diff --git a/aspnet-core/src/LeesStore.Web.Host/appsettings.json b/aspnet-core/src/LeesStore.Web.Host/appsettings.json index 8cc090a..f917cfc 100644 --- a/aspnet-core/src/LeesStore.Web.Host/appsettings.json +++ b/aspnet-core/src/LeesStore.Web.Host/appsettings.json @@ -14,5 +14,12 @@ "Issuer": "LeesStore", "Audience": "LeesStore" } + }, + "Kestrel": { + "Endpoints": { + "Http": { + "Url": "http://localhost:21021/" + } + } } } \ No newline at end of file diff --git a/aspnet-core/test/LeesStore.Web.Tests/Controllers/HomeController_Tests.cs b/aspnet-core/test/LeesStore.Web.Tests/Controllers/HomeController_Tests.cs new file mode 100644 index 0000000..ac9fc4f --- /dev/null +++ b/aspnet-core/test/LeesStore.Web.Tests/Controllers/HomeController_Tests.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using LeesStore.Models.TokenAuth; +using LeesStore.Web.Controllers; +using Shouldly; +using Xunit; + +namespace LeesStore.Web.Tests.Controllers +{ + public class HomeController_Tests: LeesStoreWebTestBase + { + [Fact] + public async Task Index_Test() + { + await AuthenticateAsync(null, new AuthenticateModel + { + UserNameOrEmailAddress = "admin", + Password = "123qwe" + }); + + //Act + var response = await GetResponseAsStringAsync( + GetUrl(nameof(HomeController.Index)) + ); + + //Assert + response.ShouldNotBeNullOrEmpty(); + } + } +} \ No newline at end of file diff --git a/aspnet-core/test/LeesStore.Web.Tests/LeesStore.Web.Tests.csproj b/aspnet-core/test/LeesStore.Web.Tests/LeesStore.Web.Tests.csproj new file mode 100644 index 0000000..47ec4cc --- /dev/null +++ b/aspnet-core/test/LeesStore.Web.Tests/LeesStore.Web.Tests.csproj @@ -0,0 +1,30 @@ + + + 1.0.0.0 + netcoreapp3.1 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + LeesStore.Web.Tests + LeesStore.Web.Tests + true + false + false + false + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + \ No newline at end of file diff --git a/aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestBase.cs b/aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestBase.cs new file mode 100644 index 0000000..8a0bb47 --- /dev/null +++ b/aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestBase.cs @@ -0,0 +1,216 @@ +using System; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using Abp.AspNetCore.TestBase; +using Abp.Authorization.Users; +using Abp.Extensions; +using Abp.Json; +using Abp.MultiTenancy; +using Abp.Web.Models; +using LeesStore.EntityFrameworkCore; +using LeesStore.Models.TokenAuth; +using LeesStore.Web.Startup; +using AngleSharp.Html.Dom; +using AngleSharp.Html.Parser; +using Microsoft.AspNetCore.Hosting; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using Shouldly; + +namespace LeesStore.Web.Tests +{ + public abstract class LeesStoreWebTestBase : AbpAspNetCoreIntegratedTestBase + { + protected static readonly Lazy ContentRootFolder; + + static LeesStoreWebTestBase() + { + ContentRootFolder = new Lazy(WebContentDirectoryFinder.CalculateContentRootFolder, true); + } + + protected override IWebHostBuilder CreateWebHostBuilder() + { + return base + .CreateWebHostBuilder() + .UseContentRoot(ContentRootFolder.Value) + .UseSetting(WebHostDefaults.ApplicationKey, typeof(LeesStoreWebMvcModule).Assembly.FullName); + } + + #region Get response + + protected async Task GetResponseAsObjectAsync(string url, + HttpStatusCode expectedStatusCode = HttpStatusCode.OK) + { + var strResponse = await GetResponseAsStringAsync(url, expectedStatusCode); + return JsonConvert.DeserializeObject(strResponse, new JsonSerializerSettings + { + ContractResolver = new CamelCasePropertyNamesContractResolver() + }); + } + + protected async Task GetResponseAsStringAsync(string url, + HttpStatusCode expectedStatusCode = HttpStatusCode.OK) + { + var response = await GetResponseAsync(url, expectedStatusCode); + return await response.Content.ReadAsStringAsync(); + } + + protected async Task GetResponseAsync(string url, + HttpStatusCode expectedStatusCode = HttpStatusCode.OK) + { + var response = await Client.GetAsync(url); + response.StatusCode.ShouldBe(expectedStatusCode); + return response; + } + + #endregion + + #region Authenticate + + /// + /// /api/TokenAuth/Authenticate + /// TokenAuthController + /// + /// + /// + /// + protected async Task AuthenticateAsync(string tenancyName, AuthenticateModel input) + { + if (tenancyName.IsNullOrWhiteSpace()) + { + var tenant = UsingDbContext(context => context.Tenants.FirstOrDefault(t => t.TenancyName == tenancyName)); + if (tenant != null) + { + AbpSession.TenantId = tenant.Id; + Client.DefaultRequestHeaders.Add("Abp.TenantId", tenant.Id.ToString()); //Set TenantId + } + } + + var response = await Client.PostAsync("/api/TokenAuth/Authenticate", + new StringContent(input.ToJsonString(), Encoding.UTF8, "application/json")); + response.StatusCode.ShouldBe(HttpStatusCode.OK); + var result = + JsonConvert.DeserializeObject>( + await response.Content.ReadAsStringAsync()); + Client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", result.Result.AccessToken); + + AbpSession.UserId = result.Result.UserId; + } + + #endregion + + #region Login + + protected void LoginAsHostAdmin() + { + LoginAsHost(AbpUserBase.AdminUserName); + } + + protected void LoginAsDefaultTenantAdmin() + { + LoginAsTenant(AbpTenantBase.DefaultTenantName, AbpUserBase.AdminUserName); + } + + protected void LoginAsHost(string userName) + { + AbpSession.TenantId = null; + + var user = + UsingDbContext( + context => + context.Users.FirstOrDefault(u => u.TenantId == AbpSession.TenantId && u.UserName == userName)); + if (user == null) + { + throw new Exception("There is no user: " + userName + " for host."); + } + + AbpSession.UserId = user.Id; + } + + protected void LoginAsTenant(string tenancyName, string userName) + { + var tenant = UsingDbContext(context => context.Tenants.FirstOrDefault(t => t.TenancyName == tenancyName)); + if (tenant == null) + { + throw new Exception("There is no tenant: " + tenancyName); + } + + AbpSession.TenantId = tenant.Id; + + var user = + UsingDbContext( + context => + context.Users.FirstOrDefault(u => u.TenantId == AbpSession.TenantId && u.UserName == userName)); + if (user == null) + { + throw new Exception("There is no user: " + userName + " for tenant: " + tenancyName); + } + + AbpSession.UserId = user.Id; + } + + #endregion + + + #region UsingDbContext + + protected void UsingDbContext(Action action) + { + using (var context = IocManager.Resolve()) + { + action(context); + context.SaveChanges(); + } + } + + protected T UsingDbContext(Func func) + { + T result; + + using (var context = IocManager.Resolve()) + { + result = func(context); + context.SaveChanges(); + } + + return result; + } + + protected async Task UsingDbContextAsync(Func action) + { + using (var context = IocManager.Resolve()) + { + await action(context); + await context.SaveChangesAsync(true); + } + } + + protected async Task UsingDbContextAsync(Func> func) + { + T result; + + using (var context = IocManager.Resolve()) + { + result = await func(context); + await context.SaveChangesAsync(true); + } + + return result; + } + + #endregion + + #region ParseHtml + + protected IHtmlDocument ParseHtml(string htmlString) + { + return new HtmlParser().ParseDocument(htmlString); + } + + #endregion + } +} \ No newline at end of file diff --git a/aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestModule.cs b/aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestModule.cs new file mode 100644 index 0000000..c58c1e3 --- /dev/null +++ b/aspnet-core/test/LeesStore.Web.Tests/LeesStoreWebTestModule.cs @@ -0,0 +1,38 @@ +using Abp.AspNetCore; +using Abp.AspNetCore.TestBase; +using Abp.Modules; +using Abp.Reflection.Extensions; +using LeesStore.EntityFrameworkCore; +using LeesStore.Web.Startup; +using Microsoft.AspNetCore.Mvc.ApplicationParts; + +namespace LeesStore.Web.Tests +{ + [DependsOn( + typeof(LeesStoreWebMvcModule), + typeof(AbpAspNetCoreTestBaseModule) + )] + public class LeesStoreWebTestModule : AbpModule + { + public LeesStoreWebTestModule(LeesStoreEntityFrameworkModule abpProjectNameEntityFrameworkModule) + { + abpProjectNameEntityFrameworkModule.SkipDbContextRegistration = true; + } + + public override void PreInitialize() + { + Configuration.UnitOfWork.IsTransactional = false; //EF Core InMemory DB does not support transactions. + } + + public override void Initialize() + { + IocManager.RegisterAssemblyByConvention(typeof(LeesStoreWebTestModule).GetAssembly()); + } + + public override void PostInitialize() + { + IocManager.Resolve() + .AddApplicationPartsIfNotAddedBefore(typeof(LeesStoreWebMvcModule).Assembly); + } + } +} \ No newline at end of file diff --git a/aspnet-core/test/LeesStore.Web.Tests/Startup.cs b/aspnet-core/test/LeesStore.Web.Tests/Startup.cs new file mode 100644 index 0000000..4c26262 --- /dev/null +++ b/aspnet-core/test/LeesStore.Web.Tests/Startup.cs @@ -0,0 +1,86 @@ +using System; +using Abp.AspNetCore; +using Abp.AspNetCore.TestBase; +using Abp.Dependency; +using LeesStore.Authentication.JwtBearer; +using LeesStore.Configuration; +using LeesStore.EntityFrameworkCore; +using LeesStore.Identity; +using LeesStore.Web.Resources; +using LeesStore.Web.Startup; +using Castle.MicroKernel.Registration; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace LeesStore.Web.Tests +{ + public class Startup + { + private readonly IConfigurationRoot _appConfiguration; + + public Startup(IWebHostEnvironment env) + { + _appConfiguration = env.GetAppConfiguration(); + } + + public IServiceProvider ConfigureServices(IServiceCollection services) + { + services.AddEntityFrameworkInMemoryDatabase(); + + services.AddMvc(); + + IdentityRegistrar.Register(services); + AuthConfigurer.Configure(services, _appConfiguration); + + services.AddScoped(); + + //Configure Abp and Dependency Injection + return services.AddAbp(options => + { + options.SetupTest(); + }); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + UseInMemoryDb(app.ApplicationServices); + + app.UseAbp(); //Initializes ABP framework. + + app.UseExceptionHandler("/Error"); + + app.UseStaticFiles(); + app.UseRouting(); + + app.UseAuthentication(); + + app.UseJwtTokenMiddleware(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); + }); + } + + private void UseInMemoryDb(IServiceProvider serviceProvider) + { + var builder = new DbContextOptionsBuilder(); + builder.UseInMemoryDatabase(Guid.NewGuid().ToString()).UseInternalServiceProvider(serviceProvider); + var options = builder.Options; + + var iocManager = serviceProvider.GetRequiredService(); + iocManager.IocContainer + .Register( + Component.For>() + .Instance(options) + .LifestyleSingleton() + ); + } + } +} \ No newline at end of file