13 lines
503 B
SQL
13 lines
503 B
SQL
-- Revert to original status check constraint without 'not_started'
|
|
-- First update any 'not_started' statuses to 'pending'
|
|
UPDATE letter_outgoing_approvals
|
|
SET status = 'pending'
|
|
WHERE status = 'not_started';
|
|
|
|
-- Drop and recreate the constraint
|
|
ALTER TABLE letter_outgoing_approvals
|
|
DROP CONSTRAINT IF EXISTS letter_outgoing_approvals_status_check;
|
|
|
|
ALTER TABLE letter_outgoing_approvals
|
|
ADD CONSTRAINT letter_outgoing_approvals_status_check
|
|
CHECK (status IN ('pending', 'approved', 'rejected')); |