upgrade-zulip: Support arbitrary database user and dbname.

Co-authored-by: Adam Birds <adam.birds@adbwebdesigns.co.uk>
This commit is contained in:
Alex Vandiver
2021-05-24 20:44:38 -07:00
committed by Tim Abbott
parent 1d59330cbc
commit 7ff3c9f966
2 changed files with 5 additions and 2 deletions

View File

@@ -581,8 +581,10 @@ def get_deploy_options(config_file: configparser.RawConfigParser) -> List[str]:
def run_psql_as_postgres(
config_file: configparser.RawConfigParser,
sql_query: str,
) -> None:
dbname = get_config(config_file, "postgresql", "database_name", "zulip")
subcmd = " ".join(
map(
shlex.quote,
@@ -590,8 +592,8 @@ def run_psql_as_postgres(
"psql",
"-v",
"ON_ERROR_STOP=1",
# TODO: Stop hardcoding the database name.
"zulip",
"-d",
dbname,
"-c",
sql_query,
],