migration 082: widen tickets.category CHECK for lead-capture categories
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0409167e5a
commit
1e34707258
1 changed files with 20 additions and 0 deletions
20
api/migrations/082_tickets_lead_categories.sql
Normal file
20
api/migrations/082_tickets_lead_categories.sql
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
-- Widen tickets.category to allow lead-capture categories posted by the DOT
|
||||
-- compliance checker (insurance, business close-out, truck-sale routing).
|
||||
-- The CHECK constraint previously only allowed the support-widget categories,
|
||||
-- so these INSERTs failed with a 500.
|
||||
|
||||
ALTER TABLE tickets DROP CONSTRAINT IF EXISTS tickets_category_check;
|
||||
|
||||
ALTER TABLE tickets ADD CONSTRAINT tickets_category_check CHECK (
|
||||
category = ANY (ARRAY[
|
||||
'question',
|
||||
'support',
|
||||
'issue',
|
||||
'service_request',
|
||||
'quote',
|
||||
'insurance_lead',
|
||||
'business_closeout',
|
||||
'truck_sale_quickcash',
|
||||
'truck_sale_marketplace'
|
||||
]::text[])
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue