ALTER TABLE public.profiles
  ADD COLUMN IF NOT EXISTS primary_owner_id UUID REFERENCES public.owners(id) ON DELETE SET NULL,
  ADD COLUMN IF NOT EXISTS primary_association_id UUID REFERENCES public.associations(id) ON DELETE SET NULL;

CREATE INDEX IF NOT EXISTS idx_profiles_primary_owner_id ON public.profiles(primary_owner_id);
CREATE INDEX IF NOT EXISTS idx_profiles_primary_association_id ON public.profiles(primary_association_id);