fix: Couldn't restore postgres from backup

This commit is contained in:
Inex Code 2024-12-23 22:15:24 +03:00
parent 914b392b1d
commit f7c3441314
No known key found for this signature in database

View file

@ -25,11 +25,10 @@ class PostgresDumper:
def restore_database(self, backup_file: str): def restore_database(self, backup_file: str):
restore_command = [ restore_command = [
"pg_restore", "pg_restore",
"--dbname=postgresql://{}@{}/{}".format( f"--dbname=postgresql://{self.user}@{self.socket_dir}",
self.user, self.socket_dir, self.db_name
),
"--clean", "--clean",
"--create", "--create",
"--exit-on-error",
backup_file, backup_file,
] ]
subprocess.run(restore_command, check=True) subprocess.run(restore_command, check=True)