- 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
11 lines
453 B
SQL
11 lines
453 B
SQL
-- 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'));
|