File size: 748 Bytes
bcf46c3
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- ============================================================================
-- 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;