Skip to content

Commit a20649a

Browse files
committed
test
1 parent d5f5cf5 commit a20649a

File tree

1 file changed

+6
-3
lines changed
  • ansible/files/admin_api_scripts/pg_upgrade_scripts

1 file changed

+6
-3
lines changed

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,16 @@ begin
384384
alter role supabase_admin_ rename to supabase_admin;
385385
386386
-- role grants
387-
-- FIXME: restore the GRANTED BY value
388-
-- FIXME: restore ADMIN OPTION value
389387
for rec in
390388
select * from pg_auth_members where member = 'supabase_admin'::regrole
391389
loop
392390
execute(format('revoke %I from supabase_admin;', rec.roleid::regrole));
393-
execute(format('grant %I to postgres;', rec.roleid::regrole));
391+
execute(format(
392+
'grant %I to postgres %s granted by %I;',
393+
rec.roleid::regrole,
394+
case when rec.admin_option then 'with admin option' else '' end,
395+
rec.grantor::regrole
396+
));
394397
end loop;
395398
396399
-- role passwords

0 commit comments

Comments
 (0)