mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-09 23:00:56 +00:00
fix: remove quotes from psql db restore
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
parent
1d9dd966b1
commit
bafa7f6598
@ -203,9 +203,9 @@ def restore_postgres(config, site_config, database_file):
|
||||
psql_command = ["psql", f"postgres://{db_root_user}:{db_root_password}@{db_host}:{db_port}"]
|
||||
|
||||
print('Restoring PostgreSQL')
|
||||
run_command(psql_command + ["-c", f"\"DROP DATABASE IF EXISTS \"{db_name}\"\""])
|
||||
run_command(psql_command + ["-c", f"\"DROP DATABASE IF EXISTS {db_name}\""])
|
||||
run_command(psql_command + ["-c", f"\"DROP USER IF EXISTS {db_name}\""])
|
||||
run_command(psql_command + ["-c ", f"\"CREATE DATABASE \"{db_name}\"\""])
|
||||
run_command(psql_command + ["-c ", f"\"CREATE DATABASE {db_name}\""])
|
||||
run_command(psql_command + ["-c", f"\"CREATE user {db_name} password '{db_password}'\""])
|
||||
run_command(psql_command + ["-c", f"\"GRANT ALL PRIVILEGES ON DATABASE \"{db_name}\" TO {db_name}\""])
|
||||
run_command(["psql", f"{psql_command[-1]}/{db_name}", "<", database_file.replace('.gz', '')])
|
||||
|
Loading…
Reference in New Issue
Block a user