From 2192f20df593d8612ffff7a9ac9a5f31f4811420 Mon Sep 17 00:00:00 2001 From: Ilkay Ilknur Date: Wed, 6 Jan 2021 15:39:17 +0300 Subject: [PATCH] fix build break caused by conflict resolving. --- .../CmsKitDbContextModelCreatingExtensions.cs | 71 ++++++++++--------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index 6a077b4f4d..5de45ed8b8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -41,8 +41,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.ConfigureByConvention(); b.ConfigureAbpUser(); - b.HasIndex(x => new { x.TenantId, x.UserName }); - b.HasIndex(x => new { x.TenantId, x.Email }); + b.HasIndex(x => new {x.TenantId, x.UserName}); + b.HasIndex(x => new {x.TenantId, x.Email}); }); } @@ -58,8 +58,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.EntityId).IsRequired().HasMaxLength(UserReactionConsts.MaxEntityIdLength); b.Property(x => x.ReactionName).IsRequired().HasMaxLength(UserReactionConsts.MaxReactionNameLength); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId, x.ReactionName }); - b.HasIndex(x => new { x.TenantId, x.CreatorId, x.EntityType, x.EntityId, x.ReactionName }); + b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId, x.ReactionName}); + b.HasIndex(x => new {x.TenantId, x.CreatorId, x.EntityType, x.EntityId, x.ReactionName}); }); } @@ -76,8 +76,8 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.Text).IsRequired().HasMaxLength(CommentConsts.MaxTextLength); b.Property(x => x.RepliedCommentId); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); - b.HasIndex(x => new { x.TenantId, x.RepliedCommentId }); + b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId}); + b.HasIndex(x => new {x.TenantId, x.RepliedCommentId}); }); } @@ -93,7 +93,7 @@ namespace Volo.CmsKit.EntityFrameworkCore r.Property(x => x.EntityType).IsRequired().HasMaxLength(RatingConsts.MaxEntityTypeLength); r.Property(x => x.EntityId).IsRequired().HasMaxLength(RatingConsts.MaxEntityIdLength); - r.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId, x.CreatorId }); + r.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId, x.CreatorId}); }); } @@ -109,49 +109,52 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); + b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId}); }); } - builder.Entity(b => + if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Tags", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Tags", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); - b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); + b.Property(x => x.EntityType).IsRequired().HasMaxLength(TagConsts.MaxEntityTypeLength); + b.Property(x => x.Name).IsRequired().HasMaxLength(TagConsts.MaxNameLength); - b.HasIndex(x => new { x.TenantId, x.Name }); - }); + b.HasIndex(x => new {x.TenantId, x.Name}); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "EntityTags", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "EntityTags", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasKey(x => new { x.EntityId, x.TagId }); + b.HasKey(x => new {x.EntityId, x.TagId}); - b.Property(x => x.EntityId).IsRequired(); - b.Property(x => x.TagId).IsRequired(); + b.Property(x => x.EntityId).IsRequired(); + b.Property(x => x.TagId).IsRequired(); - b.HasIndex(x => new { x.TenantId, x.EntityId, x.TagId }); - }); + b.HasIndex(x => new {x.TenantId, x.EntityId, x.TagId}); + }); + } - builder.Entity(b => + if (GlobalFeatureManager.Instance.IsEnabled()) { - b.ToTable(options.TablePrefix + "Pages", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Pages", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); - b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); - b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); + b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); + b.Property(x => x.Url).IsRequired().HasMaxLength(PageConsts.MaxUrlLength); + b.Property(x => x.Description).HasMaxLength(PageConsts.MaxDescriptionLength); - b.HasIndex(x => new { x.TenantId, x.Url }); - }); - b.HasIndex(x => new {x.TenantId, x.EntityType, x.EntityId}); + b.HasIndex(x => new {x.TenantId, x.Url}); }); } @@ -201,4 +204,4 @@ namespace Volo.CmsKit.EntityFrameworkCore } } } -} +} \ No newline at end of file