Browse Source

Added maxvalues to EntityChange and EntityPropertyChange

pull/395/head
Yunus Emre Kalkan 8 years ago
parent
commit
2c4ebc9dbc
  1. 9
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityChangeConsts.cs
  2. 17
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityPropertyChangeConsts.cs
  3. 12
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs

9
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityChangeConsts.cs

@ -0,0 +1,9 @@
namespace Volo.Abp.AuditLogging
{
public class EntityChangeConsts
{
public const int MaxEntityTypeFullNameLength = 128;
public const int MaxEntityIdLength = 128;
}
}

17
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/EntityPropertyChangeConsts.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.Abp.AuditLogging
{
public class EntityPropertyChangeConsts
{
public const int MaxNewValueLength = 512;
public const int MaxOriginalValueLength = 512;
public const int MaxPropertyNameLength = 128;
public const int MaxPropertyTypeFullNameLength = 64;
}
}

12
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs

@ -65,8 +65,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
b.ConfigureExtraProperties();
b.Property(x => x.EntityTypeFullName).IsRequired().HasColumnName(nameof(EntityChange.EntityTypeFullName));
b.Property(x => x.EntityId).IsRequired().HasColumnName(nameof(EntityChange.EntityId));
b.Property(x => x.EntityTypeFullName).HasMaxLength(EntityChangeConsts.MaxEntityTypeFullNameLength).IsRequired().HasColumnName(nameof(EntityChange.EntityTypeFullName));
b.Property(x => x.EntityId).HasMaxLength(EntityChangeConsts.MaxEntityIdLength).IsRequired().HasColumnName(nameof(EntityChange.EntityId));
b.Property(x => x.AuditLogId).IsRequired().HasColumnName(nameof(EntityChange.AuditLogId));
b.Property(x => x.ChangeTime).IsRequired().HasColumnName(nameof(EntityChange.ChangeTime));
b.Property(x => x.ChangeType).IsRequired().HasColumnName(nameof(EntityChange.ChangeType));
@ -82,10 +82,10 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
{
b.ToTable(tablePrefix + "EntityPropertyChanges", schema);
b.Property(x => x.NewValue).IsRequired().HasColumnName(nameof(EntityPropertyChange.NewValue));
b.Property(x => x.PropertyName).IsRequired().HasColumnName(nameof(EntityPropertyChange.PropertyName));
b.Property(x => x.PropertyTypeFullName).IsRequired().HasColumnName(nameof(EntityPropertyChange.PropertyTypeFullName));
b.Property(x => x.OriginalValue).HasColumnName(nameof(EntityPropertyChange.OriginalValue));
b.Property(x => x.NewValue).HasMaxLength(EntityPropertyChangeConsts.MaxNewValueLength).IsRequired().HasColumnName(nameof(EntityPropertyChange.NewValue));
b.Property(x => x.PropertyName).HasMaxLength(EntityPropertyChangeConsts.MaxPropertyNameLength).IsRequired().HasColumnName(nameof(EntityPropertyChange.PropertyName));
b.Property(x => x.PropertyTypeFullName).HasMaxLength(EntityPropertyChangeConsts.MaxPropertyTypeFullNameLength).IsRequired().HasColumnName(nameof(EntityPropertyChange.PropertyTypeFullName));
b.Property(x => x.OriginalValue).HasMaxLength(EntityPropertyChangeConsts.MaxOriginalValueLength).HasColumnName(nameof(EntityPropertyChange.OriginalValue));
b.HasIndex(x => new { x.EntityChangeId });
});

Loading…
Cancel
Save