fix: 完善资料审核与 Worker 状态一致性

This commit is contained in:
root
2026-09-15 08:30:39 +08:00
parent f455552e92
commit ec573b5ae2
10 changed files with 639 additions and 101 deletions
+5
View File
@@ -123,6 +123,7 @@ model Account {
}
model AnonymousProfile {
/// Review queue index anonymous_profiles_review_status_updated_at_idx is managed in 0006 SQL.
id String @id @default(uuid()) @db.Uuid
accountId String @unique @map("account_id") @db.Uuid
publicId String @unique @default(uuid()) @map("public_id") @db.Uuid
@@ -131,10 +132,12 @@ model AnonymousProfile {
avatarColor String @map("avatar_color") @db.VarChar(16)
bio String? @db.VarChar(500)
reviewStatus ReviewStatus @default(REVIEWING) @map("review_status")
version Int @default(1)
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3)
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3)
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
@@index([reviewStatus, updatedAt], map: "anonymous_profiles_review_status_updated_at_idx")
@@map("anonymous_profiles")
}
@@ -425,6 +428,7 @@ model Notification {
}
model OutboxEvent {
/// Processing lease index outbox_events_processing_lease_idx is managed in 0005 SQL.
id String @id @default(uuid()) @db.Uuid
aggregateType String @map("aggregate_type") @db.VarChar(100)
aggregateId String @map("aggregate_id") @db.Uuid
@@ -440,6 +444,7 @@ model OutboxEvent {
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3)
@@index([status, nextRetryAt])
@@index([status, lockedAt], map: "outbox_events_processing_lease_idx")
@@index([aggregateType, aggregateId])
@@map("outbox_events")
}