From dba79c0f17c2b57c51db712e8a0d5d9695d2c4c2 Mon Sep 17 00:00:00 2001 From: weeihan Date: Sun, 12 Jul 2026 17:34:44 +0800 Subject: [PATCH] fix: drop-if-exists before recreating notifications RLS policies --- supabase/migrations/20260712000019_fix_notifications_rls.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supabase/migrations/20260712000019_fix_notifications_rls.sql b/supabase/migrations/20260712000019_fix_notifications_rls.sql index 144c972..e9e213a 100644 --- a/supabase/migrations/20260712000019_fix_notifications_rls.sql +++ b/supabase/migrations/20260712000019_fix_notifications_rls.sql @@ -2,6 +2,8 @@ -- Replace with per-user policy (everyone reads own) + admin-only policy for oversight. DROP POLICY IF EXISTS "notifications_read_elevated" ON notifications_log; +DROP POLICY IF EXISTS "notifications_read_own" ON notifications_log; +DROP POLICY IF EXISTS "notifications_read_admin" ON notifications_log; CREATE POLICY "notifications_read_own" ON notifications_log FOR SELECT USING (recipient_user_id = auth.uid());