Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions migrations/tenant/0046-buckets-objects-grants.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
do $$
declare
super_user text = coalesce(current_setting('storage.super_user', true), 'postgres');
begin
execute 'grant all on storage.buckets, storage.objects to ' || super_user || ' with grant option';
end $$;

do $$
declare
anon_role text = coalesce(current_setting('storage.anon_role', true), 'anon');
authenticated_role text = coalesce(current_setting('storage.authenticated_role', true), 'authenticated');
service_role text = coalesce(current_setting('storage.service_role', true), 'service_role');
begin
execute 'grant all on storage.buckets, storage.objects to ' || service_role || ', ' || authenticated_role || ', ' || anon_role;
end $$;
1 change: 1 addition & 0 deletions src/internal/database/migrations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ export const DBMigration = {
'fix-object-level': 43,
'vector-bucket-type': 44,
'vector-buckets': 45,
'buckets-objects-grants': 46,
}
Loading