opticparse-python / supabase /migrations /002_rls_watches_monitors.sql
Nanny7's picture
initial deploy
bcf46c3
Raw History Blame Contribute Delete
748 Bytes
-- ============================================================================
-- Migration: Enable RLS on backend-only tables (watches, monitors)
--
-- Description:
-- These tables lack a user_id column and are never queried directly via the
-- frontend using the anon key. Enabling RLS without defining any policies
-- successfully locks them down so they cannot be read or modified by anyone
-- accessing the Supabase REST/GraphQL API. The backend services connect directly
-- via DATABASE_URL (PostgreSQL connection), which naturally bypasses RLS.
-- ============================================================================
ALTER TABLE public.watches ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.monitors ENABLE ROW LEVEL SECURITY;