dukcapil/migrations/000025_add_not_started_approval_status.down.sql
Aditya Siregar aa662a321f Update
2025-09-01 12:06:14 +07:00

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'));