ALTER TABLE public.units ADD COLUMN IF NOT EXISTS lot text; CREATE INDEX IF NOT EXISTS idx_units_lot ON public.units (lot) WHERE lot IS NOT NULL;