fix: persist uncertain cancel outcomes

This commit is contained in:
jordan
2026-07-29 17:17:14 +09:00
parent a656350a35
commit 3dd8eefc92
21 changed files with 416 additions and 76 deletions
@@ -0,0 +1,18 @@
-- dcy-041 / GitHub #44: cancellation request acceptance is distinct from
-- final order cancellation. Persist the immediate result to prevent blind
-- automatic retries across execution ticks and daemon restarts.
ALTER TABLE daily_slot
ADD COLUMN IF NOT EXISTS cancel_state TEXT;
ALTER TABLE daily_slot
ADD COLUMN IF NOT EXISTS cancel_requested_at TIMESTAMPTZ;
ALTER TABLE daily_slot
DROP CONSTRAINT IF EXISTS daily_slot_cancel_state_check;
ALTER TABLE daily_slot
ADD CONSTRAINT daily_slot_cancel_state_check
CHECK (
cancel_state IS NULL
OR cancel_state IN ('requested', 'rejected', 'unknown')
);