ALTER TABLE public.chart_of_accounts DROP CONSTRAINT IF EXISTS chart_of_accounts_account_number_unique; CREATE UNIQUE INDEX IF NOT EXISTS chart_of_accounts_number_per_system_unique ON public.chart_of_accounts(account_number, accounting_system);