You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clicking the "Pause" button next to a scheduled purchase fails with:
Failed to pause purchase: execution b030ec47-5c02-46b6-b97f-1df38da3c61b cannot be paused: ERROR: new row for relation "purchase_executions" violates check constraint "valid_status" (SQLSTATE 23514)
The DB check constraint valid_status on purchase_executions doesn't accept whatever status the pause flow is trying to write.
Likely causes (verify)
The pause handler writes a status string (e.g. paused) that is not in the valid_status CHECK constraint enum on purchase_executions. Either:
Add paused (and any adjacent states) to the CHECK constraint via a migration, OR
Change the handler to use an existing valid status (less likely correct -- the action is genuinely pausing).
The status transition is from a state where Pause shouldn't be valid (e.g. trying to pause an already-completed execution), and the handler doesn't pre-validate.
Acceptance
Clicking Pause on a scheduled (pending) execution succeeds, the row's status becomes the documented "paused" state, and the toast confirms.
A new migration adds the paused status to the valid_status CHECK constraint (using a transactional ALTER TABLE pattern).
Pre-validate in the handler: return a clean 4xx with a clear message when the source status isn't pause-eligible (do NOT return a generic 500 with the SQL error string).
Regression test exercises the pause transition end-to-end with both eligible and ineligible source statuses.
Activity
fix(purchases): add 'paused' to valid_status CHECK constraint so Paus…
cristim commentedon May 28, 2026
Verified shipped: PR #779 (commit dca027c, merged 2026-05-28) is in feat/multicloud-web-frontend. Migration 000055_add_paused_status.up.sql adds 'paused' to valid_status CHECK constraint. Tests in handler_purchases_test.go.
fix(planned-purchases): Pause is visible + reversible (badge, toast, …
fix(planned-purchases): Pause is visible + reversible (badge, toast, …