Skip to content

Commit 3fc6b5e

Browse files
committed
improve migration
1 parent f902775 commit 3fc6b5e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

supabase/migrations/20250603081351_row-level-security.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,27 @@
44
BEGIN;
55

66
ALTER TABLE public.listened ENABLE ROW LEVEL SECURITY;
7-
CREATE POLICY "Allow unauthenticated access"
7+
DROP POLICY IF EXISTS "Allow unauthenticated access" ON public.listened;
8+
CREATE POLICY "select_public"
89
ON public.listened
910
FOR SELECT
1011
USING (true);
1112

1213
ALTER TABLE public.hooman ENABLE ROW LEVEL SECURITY;
13-
CREATE POLICY "Allow public read access" ON public.hooman
14+
DROP POLICY IF EXISTS "Allow unauthenticated access" ON public.hooman;
15+
CREATE POLICY "select_public" ON public.hooman
1416
FOR SELECT
1517
USING (true);
1618

1719
ALTER TABLE public.hooman_artist ENABLE ROW LEVEL SECURITY;
20+
DROP POLICY IF EXISTS "select_public" ON public.hooman_artist;
1821
CREATE POLICY select_public ON public.hooman_artist
1922
FOR SELECT
2023
USING (true);
2124

2225
ALTER TABLE public.artist ENABLE ROW LEVEL SECURITY;
23-
CREATE POLICY select_artist ON public.artist
26+
DROP POLICY IF EXISTS "select_public" ON public.artist;
27+
CREATE POLICY select_public ON public.artist
2428
FOR SELECT
2529
USING (true);
2630

0 commit comments

Comments
 (0)