mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
14 lines
646 B
SQL
14 lines
646 B
SQL
|
|
-- Drop the unique constraint on (association_id, charge_type) to allow multiple mappings per charge type
|
|
ALTER TABLE public.buildium_gl_mappings DROP CONSTRAINT IF EXISTS buildium_gl_mappings_association_id_charge_type_key;
|
|
|
|
-- Add amount threshold columns
|
|
ALTER TABLE public.buildium_gl_mappings
|
|
ADD COLUMN IF NOT EXISTS amount_min numeric DEFAULT NULL,
|
|
ADD COLUMN IF NOT EXISTS amount_max numeric DEFAULT NULL;
|
|
|
|
-- Add a unique constraint that includes amount thresholds
|
|
ALTER TABLE public.buildium_gl_mappings
|
|
ADD CONSTRAINT buildium_gl_mappings_assoc_type_amount_unique
|
|
UNIQUE (association_id, charge_type, amount_min, amount_max);
|