migration 098: allow compliance order types in order_audit_log
The admin compliance-orders approve/re-arm actions write order_audit_log rows
with order_type='compliance', but the CHECK constraint (from migration 004)
only allowed formation/service/quote -- so every approve failed with a 500
('Approve failed.'). Expand the constraint to include compliance + compliance_batch.
This commit is contained in:
parent
3df3a08221
commit
73c27c75b1
1 changed files with 17 additions and 0 deletions
17
api/migrations/098_audit_log_compliance_type.sql
Normal file
17
api/migrations/098_audit_log_compliance_type.sql
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
-- 098: Allow compliance order types in order_audit_log.
|
||||
--
|
||||
-- order_audit_log was created (migration 004) for formation orders only, with a
|
||||
-- CHECK constraint limiting order_type to ('formation','service','quote'). The
|
||||
-- admin compliance-orders dashboard writes audit entries for compliance orders
|
||||
-- (approve-for-submission, intake re-arm), which were rejected by that check and
|
||||
-- surfaced as "Approve failed" 500s. Add the compliance order types.
|
||||
--
|
||||
-- Idempotent: drops and recreates the constraint with the expanded value set.
|
||||
|
||||
ALTER TABLE order_audit_log DROP CONSTRAINT IF EXISTS order_audit_log_order_type_check;
|
||||
|
||||
ALTER TABLE order_audit_log
|
||||
ADD CONSTRAINT order_audit_log_order_type_check
|
||||
CHECK (order_type IN (
|
||||
'formation', 'service', 'quote', 'compliance', 'compliance_batch'
|
||||
));
|
||||
Loading…
Add table
Add a link
Reference in a new issue