fix: identity 登录并发改为 xmin
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 8s

移除 identity_users 对 RowVersion 列的依赖,改用 PostgreSQL xmin 作为并发令牌,修复线上登录因缺失 RowVersion 列导致的 500 错误。
This commit is contained in:
2026-02-06 12:11:52 +08:00
parent f10319d96b
commit ec5293d892
4 changed files with 8 additions and 10 deletions

View File

@@ -104,10 +104,12 @@ public sealed class IdentityDbContext(
builder.Property(x => x.LastLoginAt);
builder.Property(x => x.MustChangePassword).IsRequired();
builder.Property(x => x.Avatar).HasColumnType("text");
builder.Property(x => x.RowVersion)
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnType("bytea");
builder.Ignore(x => x.RowVersion);
builder.Property<uint>("xmin")
.HasColumnName("xmin")
.HasColumnType("xid")
.ValueGeneratedOnAddOrUpdate()
.IsConcurrencyToken();
builder.Property(x => x.TenantId).IsRequired();
ConfigureAuditableEntity(builder);
ConfigureSoftDeleteEntity(builder);