diff --git a/migrations/034_add_posted_status.sql b/migrations/034_add_posted_status.sql new file mode 100644 index 0000000..5669cfa --- /dev/null +++ b/migrations/034_add_posted_status.sql @@ -0,0 +1,10 @@ +-- Migration 034: Add 'posted' status to tmodule_orders check constraint +-- Date: 2025-12-23 +-- Issue: e-conomic export sets status='posted' but constraint doesn't allow it + +-- Drop the old constraint +ALTER TABLE tmodule_orders DROP CONSTRAINT IF EXISTS check_status; + +-- Add new constraint with 'posted' status included +ALTER TABLE tmodule_orders ADD CONSTRAINT check_status + CHECK (status IN ('draft', 'exported', 'posted', 'sent', 'cancelled'));