ALTER TABLE public.units
  ADD COLUMN IF NOT EXISTS assessment_account_id uuid NULL REFERENCES public.chart_of_accounts(id) ON DELETE SET NULL;

CREATE INDEX IF NOT EXISTS units_assessment_account_id_idx
  ON public.units(assessment_account_id);