ALTER TABLE public.owner_ledger_entries
ADD COLUMN IF NOT EXISTS is_archived boolean NOT NULL DEFAULT false;

CREATE INDEX IF NOT EXISTS idx_owner_ledger_entries_is_archived
  ON public.owner_ledger_entries (unit_id, is_archived);