Browse Source

Better implement max lengths for oracle.

pull/4161/head
Halil İbrahim Kalkan 6 years ago
parent
commit
fa364fe3d2
  1. 3
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs
  2. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs
  3. 10
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs
  4. 1
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs
  5. 18
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs
  6. 1
      modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/SettingConsts.cs
  7. 10
      modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs

3
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs

@ -16,6 +16,9 @@
public const int MaxExceptionsLength = 4000;
//TODO: Replace with MaxExceptionsLength in v3.0
public static int MaxExceptionsLengthValue { get; set; } = MaxExceptionsLength;
public const int MaxCommentsLength = 256;
public const int MaxUrlLength = 256;

2
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs

@ -99,7 +99,7 @@ namespace Volo.Abp.AuditLogging
Exceptions = auditInfo
.Exceptions?
.JoinAsString(Environment.NewLine)
.Truncate(AuditLogConsts.MaxExceptionsLength);
.Truncate(AuditLogConsts.MaxExceptionsLengthValue);
Comments = auditInfo
.Comments?

10
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingDbContextModelBuilderExtensions.cs

@ -37,14 +37,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
b.Property(x => x.Url).HasMaxLength(AuditLogConsts.MaxUrlLength).HasColumnName(nameof(AuditLog.Url));
b.Property(x => x.HttpStatusCode).HasColumnName(nameof(AuditLog.HttpStatusCode));
if (builder.IsUsingOracle())
{
b.Property(x => x.Exceptions).HasMaxLength(2000).HasColumnName(nameof(AuditLog.Exceptions));
}
else
{
b.Property(x => x.Exceptions).HasMaxLength(AuditLogConsts.MaxExceptionsLength).HasColumnName(nameof(AuditLog.Exceptions));
}
if (builder.IsUsingOracle()) { AuditLogConsts.MaxExceptionsLengthValue = 2000; }
b.Property(x => x.Exceptions).HasMaxLength(AuditLogConsts.MaxExceptionsLengthValue).HasColumnName(nameof(AuditLog.Exceptions));
b.Property(x => x.Comments).HasMaxLength(AuditLogConsts.MaxCommentsLength).HasColumnName(nameof(AuditLog.Comments));
b.Property(x => x.ExecutionDuration).HasColumnName(nameof(AuditLog.ExecutionDuration));

1
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs

@ -4,6 +4,7 @@
{
public const int TypeMaxLength = 250;
public const int ValueMaxLength = 4000;
public static int ValueMaxLengthValue { get; set; } = ValueMaxLength;
public const int DescriptionMaxLength = 2000;
}
}

18
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

@ -131,12 +131,10 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
b.Property(x => x.Value).HasMaxLength(300).IsRequired();
}
else
{
b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired();
SecretConsts.ValueMaxLengthValue = 300;
}
b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLengthValue).IsRequired();
b.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength);
});
@ -272,12 +270,10 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{
b.Property(x => x.Value).HasMaxLength(300).IsRequired();
}
else
{
b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLength).IsRequired();
}
SecretConsts.ValueMaxLengthValue = 300;
}
b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLengthValue).IsRequired();
});
builder.Entity<ApiResourceClaim>(b =>

1
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/SettingConsts.cs

@ -4,6 +4,7 @@
{
public const int MaxNameLength = 128;
public const int MaxValueLength = 2048;
public static int MaxValueLengthValue { get; set; } = MaxValueLength;
public const int MaxProviderNameLength = 64;
public const int MaxProviderKeyLength = 64;
}

10
modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContextModelBuilderExtensions.cs

@ -42,14 +42,8 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore
b.Property(x => x.Name).HasMaxLength(SettingConsts.MaxNameLength).IsRequired();
if (builder.IsUsingOracle())
{
b.Property(x => x.Value).HasMaxLength(2000).IsRequired();
}
else
{
b.Property(x => x.Value).HasMaxLength(SettingConsts.MaxValueLength).IsRequired();
}
if (builder.IsUsingOracle()) { SettingConsts.MaxValueLengthValue = 2000; }
b.Property(x => x.Value).HasMaxLength(SettingConsts.MaxValueLengthValue).IsRequired();
b.Property(x => x.ProviderName).HasMaxLength(SettingConsts.MaxProviderNameLength);
b.Property(x => x.ProviderKey).HasMaxLength(SettingConsts.MaxProviderKeyLength);

Loading…
Cancel
Save