-- causing Postgres to detect infinite recursion. -- Solution: use a SECURITY DEFINER function to bypass RLS for the check. -- Drop whichever policy name exists (old name on local, new name on remote) ...
DROP POLICY IF EXISTS "Users can view own profile" ON user_profiles; DROP POLICY IF EXISTS "Admins can view all profiles" ON user_profiles; DROP POLICY IF EXISTS ...