Skip to content

Commit 57c9aa9

Browse files
committed
chore: catch grant exceptions per-function
1 parent 1747f29 commit 57c9aa9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

migrations/db/migrations/20211124212715_update-auth-owner.sql

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@
44
DO $$
55
BEGIN
66
ALTER FUNCTION auth.uid owner to supabase_auth_admin;
7+
EXCEPTION WHEN OTHERS THEN
8+
RAISE WARNING 'Error encountered when changing owner of auth.uid to supabase_auth_admin';
9+
END $$;
10+
11+
DO $$
12+
BEGIN
713
ALTER FUNCTION auth.role owner to supabase_auth_admin;
14+
EXCEPTION WHEN OTHERS THEN
15+
RAISE WARNING 'Error encountered when changing owner of auth.role to supabase_auth_admin';
16+
END $$;
17+
18+
DO $$
19+
BEGIN
820
ALTER FUNCTION auth.email owner to supabase_auth_admin;
921
EXCEPTION WHEN OTHERS THEN
10-
RAISE WARNING 'Error encountered when changing owner of auth.uid, auth.role or auth.email to supabase_auth_admin';
22+
RAISE WARNING 'Error encountered when changing owner of auth.email to supabase_auth_admin';
1123
END $$;
1224
-- migrate:down

0 commit comments

Comments
 (0)