File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
ansible/files/admin_api_scripts/pg_upgrade_scripts Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -311,15 +311,11 @@ function initiate_upgrade {
311
311
echo " 7. Disabling extensions and generating post-upgrade script"
312
312
handle_extensions
313
313
314
- # TODO: Only do postgres <-> supabase_admin swap if upgrading from postgres
315
- # as bootstrap user to supabase_admin as bootstrap user.
316
-
317
- echo " 8. TODO"
314
+ echo " 8. Swap postgres & supabase_admin roles if upgrading from a project with postgres as bootstrap user"
318
315
if [ " $OLD_BOOTSTRAP_USER " = " postgres" ]; then
319
316
run_sql -c " alter role postgres superuser; create role supabase_tmp login superuser;"
320
- psql -h localhost -U supabase_tmp -d postgres << -EOSQL
321
- begin;
322
- do \$\$
317
+ psql -h localhost -U supabase_tmp -d postgres << 'EOSQL '
318
+ do $$
323
319
declare
324
320
postgres_rolpassword text := (select rolpassword from pg_authid where rolname = 'postgres');
325
321
supabase_admin_rolpassword text := (select rolpassword from pg_authid where rolname = 'supabase_admin');
@@ -468,7 +464,7 @@ begin
468
464
execute(format('alter table %I.%I owner to postgres;', rec.relnamespace::regnamespace, rec.relname));
469
465
end loop;
470
466
end
471
- \$\ $ ;
467
+ $ $;
472
468
EOSQL
473
469
run_sql -c " alter role postgres nosuperuser; drop role supabase_tmp;"
474
470
fi
You can’t perform that action at this time.
0 commit comments