2
0
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:
Chinmay D. Pai 2020-07-10 10:27:36 +05:30
parent 1d9dd966b1
commit bafa7f6598
No known key found for this signature in database
GPG Key ID: 75507BE256F40CED

View File

@ -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', '')])