fix: persist uncertain cancel outcomes
This commit is contained in:
@@ -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')
|
||||
);
|
||||
Reference in New Issue
Block a user