Fix: Tilføj 'posted' status til tmodule_orders check constraint
- Database constraint tillod kun: draft, exported, sent, cancelled - Code satte status til 'posted' efter e-conomic export - Tilføjet 'posted' til check_status constraint - Fixes: new row violates check constraint error
This commit is contained in:
parent
5c96639a79
commit
3b8bae3186
10
migrations/034_add_posted_status.sql
Normal file
10
migrations/034_add_posted_status.sql
Normal file
@ -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'));
|
||||||
Loading…
Reference in New Issue
Block a user