diff --git a/supabase/migrations/20251007161700_enable_public_schema_rls.sql b/supabase/migrations/20251007161700_enable_public_schema_rls.sql new file mode 100644 index 0000000..a50f013 --- /dev/null +++ b/supabase/migrations/20251007161700_enable_public_schema_rls.sql @@ -0,0 +1,17 @@ +DO $$ +DECLARE + target_schema text := 'public'; + table_name text; +BEGIN + FOR table_name IN + SELECT c.relname + FROM pg_class c + JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE n.nspname = target_schema + AND c.relkind = 'r' + LOOP + EXECUTE format('ALTER TABLE %I.%I ENABLE ROW LEVEL SECURITY;', target_schema, table_name); + END LOOP; +END $$; + +REVOKE USAGE ON SCHEMA public FROM anon, authenticated; \ No newline at end of file