From 9544acb8ace57630f43d52cb9b556cd40c9a189b Mon Sep 17 00:00:00 2001 From: Nokecy Date: Fri, 14 Dec 2018 21:24:07 +0800 Subject: [PATCH] =?UTF-8?q?fix=20Duplicate=20key=20(AuditLogId=E3=80=81Aud?= =?UTF-8?q?itLogId1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbpAuditLoggingtDbContextModelBuilderExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs index 820d098951..9a39a06dc2 100644 --- a/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs +++ b/modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs @@ -39,8 +39,8 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore b.Property(x => x.UserName).HasMaxLength(AuditLogConsts.MaxUserNameLength).HasColumnName(nameof(AuditLog.UserName)); b.Property(x => x.TenantId).HasColumnName(nameof(AuditLog.TenantId)); - b.HasMany().WithOne().HasForeignKey(x => x.AuditLogId); - b.HasMany().WithOne().HasForeignKey(x => x.AuditLogId); + b.HasMany(a => a.Actions).WithOne().HasForeignKey(x => x.AuditLogId).IsRequired(); + b.HasMany(a => a.EntityChanges).WithOne().HasForeignKey(x => x.AuditLogId).IsRequired(); b.HasIndex(x => new { x.TenantId, x.ExecutionTime }); b.HasIndex(x => new { x.TenantId, x.UserId, x.ExecutionTime });