mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 01:40:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
12 lines
523 B
SQL
12 lines
523 B
SQL
|
|
-- Add association_ids array column to chart_of_accounts
|
|
ALTER TABLE public.chart_of_accounts ADD COLUMN association_ids UUID[] DEFAULT '{}';
|
|
|
|
-- Migrate existing association_id values into the array
|
|
UPDATE public.chart_of_accounts
|
|
SET association_ids = ARRAY[association_id]
|
|
WHERE association_id IS NOT NULL AND (association_ids IS NULL OR association_ids = '{}');
|
|
|
|
-- Create index for array containment queries
|
|
CREATE INDEX idx_chart_of_accounts_association_ids ON public.chart_of_accounts USING GIN (association_ids);
|