-- これらが互いに team_members の RLS を再帰評価し、 -- "infinite recursion detected in policy for relation team_members" (42P17) を発生させていた。 where team_id = _team_id and user_id = auth.uid() revoke all on function ...
-- Run in Supabase → SQL Editor (after 001 / 002). Safe to run multiple times. -- 1) Policies use plain auth.uid() = id (avoids odd planner/RLS re-entrancy with subselects). -- 2) Login check uses RPC ...