fix(orchestration): atomically queue approvals with optional not-before schedule
Deploy Canina / deploy (push) Successful in 4m56s

This commit is contained in:
devops committed 2026-10-24 06:16:20 +00:00
1 parent ab2f330eb8
commit 50d0df822c
15 files changed
+216 -65

No files matched your search

@@ -0,0 +1,3 @@
-- Scheduling is distinct from immutable approval validity. Existing queues run immediately.
ALTER TABLE "prepare_workflow_outbox" ADD COLUMN "not_before" TIMESTAMPTZ;
CREATE INDEX "prepare_workflow_outbox_due_idx" ON "prepare_workflow_outbox" ("status", "not_before", "created_at");
+2
View File
@@ -1239,6 +1239,7 @@ model PrepareWorkflowOutbox {
taskId String @unique @map("task_id") @db.Uuid
status String @default("PENDING") @db.VarChar(20)
attempts Int @default(0)
notBefore DateTime? @map("not_before") @db.Timestamptz()
leaseOwner String? @map("lease_owner") @db.VarChar(100)
leaseToken String? @map("lease_token") @db.Uuid
leaseUntil DateTime? @map("lease_until") @db.Timestamptz()
@@ -1247,5 +1248,6 @@ model PrepareWorkflowOutbox {
reservationId String? @map("reservation_id") @db.Uuid
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
@@index([status, leaseUntil])
@@index([status, notBefore, createdAt], map: "prepare_workflow_outbox_due_idx")
@@map("prepare_workflow_outbox")
}