{"-- Disable RLS on all tables for local development
-- This migration must run BEFORE other migrations to ensure clean reset
-- (In Supabase local dev, RLS often conflicts with non-privileged anon access)
DO $$
DECLARE r record;
BEGIN
  -- Disable RLS on all existing tables (this is a no-op on first run, idempotent)
  FOR r IN SELECT tablename FROM pg_tables WHERE schemaname = 'public' LOOP
    EXECUTE format('ALTER TABLE public.%I DISABLE ROW LEVEL SECURITY', r.tablename);
  END LOOP;
END $$"}