Symptom (Planned Purchases 6.1)
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.
Source
Planned Purchases 6.1, exploratory testing 2026-05-27.
Symptom (Planned Purchases 6.1)
Clicking the "Pause" button next to a scheduled purchase fails with:
The DB check constraint
valid_statusonpurchase_executionsdoesn'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 thevalid_statusCHECK constraint enum onpurchase_executions. Either:paused(and any adjacent states) to the CHECK constraint via a migration, ORThe 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
pausedstatus to thevalid_statusCHECK constraint (using a transactional ALTER TABLE pattern).Source
Planned Purchases 6.1, exploratory testing 2026-05-27.