|  |  |  | @ -28,14 +28,25 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureAbpUser(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.NormalizedUserName).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedUserNameLength).HasColumnName(nameof(IdentityUser.NormalizedUserName)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.NormalizedEmail).IsRequired().HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength).HasColumnName(nameof(IdentityUser.NormalizedEmail)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.PasswordHash).HasMaxLength(IdentityUserConsts.MaxPasswordHashLength).HasColumnName(nameof(IdentityUser.PasswordHash)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.SecurityStamp).IsRequired().HasMaxLength(IdentityUserConsts.MaxSecurityStampLength).HasColumnName(nameof(IdentityUser.SecurityStamp)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.TwoFactorEnabled).HasDefaultValue(false).HasColumnName(nameof(IdentityUser.TwoFactorEnabled)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.LockoutEnabled).HasDefaultValue(false).HasColumnName(nameof(IdentityUser.LockoutEnabled)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.AccessFailedCount).HasDefaultValue(0).HasColumnName(nameof(IdentityUser.AccessFailedCount)); | 
			
		
	
		
			
				
					|  |  |  |  |                  | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.NormalizedUserName).IsRequired() | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasMaxLength(IdentityUserConsts.MaxNormalizedUserNameLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.NormalizedUserName)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.NormalizedEmail).IsRequired() | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasMaxLength(IdentityUserConsts.MaxNormalizedEmailLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.NormalizedEmail)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.PasswordHash).HasMaxLength(IdentityUserConsts.MaxPasswordHashLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.PasswordHash)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.SecurityStamp).IsRequired().HasMaxLength(IdentityUserConsts.MaxSecurityStampLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.SecurityStamp)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.TwoFactorEnabled).HasDefaultValue(false) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.TwoFactorEnabled)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.LockoutEnabled).HasDefaultValue(false) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.LockoutEnabled)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.AccessFailedCount) | 
			
		
	
		
			
				
					|  |  |  |  |                     .If(!builder.IsUsingOracle(), p => p.HasDefaultValue(0)) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityUser.AccessFailedCount)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasMany(u => u.Claims).WithOne().HasForeignKey(uc => uc.UserId).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasMany(u => u.Logins).WithOne().HasForeignKey(ul => ul.UserId).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasMany(u => u.Roles).WithOne().HasForeignKey(ur => ur.UserId).IsRequired(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -55,7 +66,7 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(x => x.Id).ValueGeneratedNever(); | 
			
		
	
		
			
				
					|  |  |  |  |                  | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.ClaimType).HasMaxLength(IdentityUserClaimConsts.MaxClaimTypeLength).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.ClaimValue).HasMaxLength(IdentityUserClaimConsts.MaxClaimValueLength); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -68,12 +79,12 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(ur => new { ur.UserId, ur.RoleId }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(ur => new {ur.UserId, ur.RoleId}); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasOne<IdentityRole>().WithMany().HasForeignKey(ur => ur.RoleId).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasOne<IdentityUser>().WithMany(u => u.Roles).HasForeignKey(ur => ur.UserId).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(ur => new { ur.RoleId, ur.UserId }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(ur => new {ur.RoleId, ur.UserId}); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             builder.Entity<IdentityUserLogin>(b => | 
			
		
	
	
		
			
				
					|  |  |  | @ -82,13 +93,16 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(x => new { x.UserId, x.LoginProvider }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(x => new {x.UserId, x.LoginProvider}); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserLoginConsts.MaxLoginProviderLength).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.ProviderKey).HasMaxLength(IdentityUserLoginConsts.MaxProviderKeyLength).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.ProviderDisplayName).HasMaxLength(IdentityUserLoginConsts.MaxProviderDisplayNameLength); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserLoginConsts.MaxLoginProviderLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.ProviderKey).HasMaxLength(IdentityUserLoginConsts.MaxProviderKeyLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.ProviderDisplayName) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasMaxLength(IdentityUserLoginConsts.MaxProviderDisplayNameLength); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(l => new { l.LoginProvider, l.ProviderKey }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(l => new {l.LoginProvider, l.ProviderKey}); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             builder.Entity<IdentityUserToken>(b => | 
			
		
	
	
		
			
				
					|  |  |  | @ -97,9 +111,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(l => new { l.UserId, l.LoginProvider, l.Name }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(l => new {l.UserId, l.LoginProvider, l.Name}); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserTokenConsts.MaxLoginProviderLength).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.LoginProvider).HasMaxLength(IdentityUserTokenConsts.MaxLoginProviderLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ul => ul.Name).HasMaxLength(IdentityUserTokenConsts.MaxNameLength).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -111,7 +126,9 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(r => r.Name).IsRequired().HasMaxLength(IdentityRoleConsts.MaxNameLength); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(r => r.NormalizedName).IsRequired().HasMaxLength(IdentityRoleConsts.MaxNormalizedNameLength); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.ConcurrencyStamp).IsRequired().IsConcurrencyToken().HasMaxLength(IdentityRoleConsts.MaxConcurrencyStampLength).HasColumnName(nameof(IdentityRole.ConcurrencyStamp)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(u => u.ConcurrencyStamp).IsRequired().IsConcurrencyToken() | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasMaxLength(IdentityRoleConsts.MaxConcurrencyStampLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityRole.ConcurrencyStamp)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(r => r.IsDefault).HasColumnName(nameof(IdentityRole.IsDefault)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(r => r.IsStatic).HasColumnName(nameof(IdentityRole.IsStatic)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(r => r.IsPublic).HasColumnName(nameof(IdentityRole.IsPublic)); | 
			
		
	
	
		
			
				
					|  |  |  | @ -141,11 +158,14 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.Name).HasMaxLength(IdentityClaimTypeConsts.MaxNameLength).IsRequired(); // make unique | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.Name).HasMaxLength(IdentityClaimTypeConsts.MaxNameLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .IsRequired(); // make unique | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.Regex).HasMaxLength(IdentityClaimTypeConsts.MaxRegexLength); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.RegexDescription).HasMaxLength(IdentityClaimTypeConsts.MaxRegexDescriptionLength); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.Description).HasMaxLength(IdentityClaimTypeConsts.MaxDescriptionLength); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.ConcurrencyStamp).IsRequired().IsConcurrencyToken().HasMaxLength(IdentityClaimTypeConsts.MaxConcurrencyStampLength).HasColumnName(nameof(IdentityClaimType.ConcurrencyStamp)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(uc => uc.ConcurrencyStamp).IsRequired().IsConcurrencyToken() | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasMaxLength(IdentityClaimTypeConsts.MaxConcurrencyStampLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(IdentityClaimType.ConcurrencyStamp)); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             builder.Entity<OrganizationUnit>(b => | 
			
		
	
	
		
			
				
					|  |  |  | @ -154,8 +174,10 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ou => ou.Code).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxCodeLength).HasColumnName(nameof(OrganizationUnit.Code)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ou => ou.DisplayName).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxDisplayNameLength).HasColumnName(nameof(OrganizationUnit.DisplayName)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ou => ou.Code).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxCodeLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(OrganizationUnit.Code)); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.Property(ou => ou.DisplayName).IsRequired().HasMaxLength(OrganizationUnitConsts.MaxDisplayNameLength) | 
			
		
	
		
			
				
					|  |  |  |  |                     .HasColumnName(nameof(OrganizationUnit.DisplayName)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasMany<OrganizationUnit>().WithOne().HasForeignKey(ou => ou.ParentId); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasMany(ou => ou.Roles).WithOne().HasForeignKey(our => our.OrganizationUnitId).IsRequired(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -169,11 +191,11 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(ou => new { ou.OrganizationUnitId, ou.RoleId }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(ou => new {ou.OrganizationUnitId, ou.RoleId}); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasOne<IdentityRole>().WithMany().HasForeignKey(ou => ou.RoleId).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(ou => new { ou.RoleId, ou.OrganizationUnitId }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(ou => new {ou.RoleId, ou.OrganizationUnitId}); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             builder.Entity<IdentityUserOrganizationUnit>(b => | 
			
		
	
	
		
			
				
					|  |  |  | @ -182,12 +204,12 @@ namespace Volo.Abp.Identity.EntityFrameworkCore | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.ConfigureByConvention(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(ou => new { ou.OrganizationUnitId, ou.UserId }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasKey(ou => new {ou.OrganizationUnitId, ou.UserId}); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasOne<OrganizationUnit>().WithMany().HasForeignKey(ou => ou.OrganizationUnitId).IsRequired(); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(ou => new { ou.UserId, ou.OrganizationUnitId }); | 
			
		
	
		
			
				
					|  |  |  |  |                 b.HasIndex(ou => new {ou.UserId, ou.OrganizationUnitId}); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | } |