fix: 完善资料审核与 Worker 状态一致性
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE "anonymous_profiles"
|
||||
ADD COLUMN "version" INTEGER NOT NULL DEFAULT 1;
|
||||
|
||||
CREATE INDEX "anonymous_profiles_review_status_updated_at_idx"
|
||||
ON "anonymous_profiles"("review_status", "updated_at");
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user