Skip to content

Commit 1747f29

Browse files
committed
fix: continue running migrations when auth.uid/auth.role/auth.email are missing in database
1 parent ccab863 commit 1747f29

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
-- migrate:up
22

33
-- update owner for auth.uid, auth.role and auth.email functions
4-
ALTER FUNCTION auth.uid owner to supabase_auth_admin;
5-
ALTER FUNCTION auth.role owner to supabase_auth_admin;
6-
ALTER FUNCTION auth.email owner to supabase_auth_admin;
7-
4+
DO $$
5+
BEGIN
6+
ALTER FUNCTION auth.uid owner to supabase_auth_admin;
7+
ALTER FUNCTION auth.role owner to supabase_auth_admin;
8+
ALTER FUNCTION auth.email owner to supabase_auth_admin;
9+
EXCEPTION WHEN OTHERS THEN
10+
RAISE WARNING 'Error encountered when changing owner of auth.uid, auth.role or auth.email to supabase_auth_admin';
11+
END $$;
812
-- migrate:down

0 commit comments

Comments
 (0)