diff --git a/pg_migration_tool/main.py b/pg_migration_tool/main.py index dfcc541..31f20b3 100644 --- a/pg_migration_tool/main.py +++ b/pg_migration_tool/main.py @@ -127,7 +127,7 @@ def generate_pg_dump_and_restore_cmd(self, event: Select.Changed)-> str: db = config["dbs"][event.value] dump_path = self.construct_path_to_dump(db) pg_dump_cmd = f'PGPASSWORD="{db['source']['db_password']}" pg_dump -h {db['source']['db_connection_host']} -U {db['source']['db_username']} -d {db['source']['db_database_name']} --create --clean --encoding utf8 --format directory --jobs 16 -Z 0 -v --file={dump_path}' - pg_restore_cmd = f'PGPASSWORD="{db['target']['db_password']}" pg_restore -h {db['target']['db_connection_host']} -U {db['target']['db_username']} -d {db['target']['db_database_name']} --clean -vv {dump_path}' + pg_restore_cmd = f'PGPASSWORD="{db['target']['db_password']}" pg_restore -h {db['target']['db_connection_host']} -U {db['target']['db_username']} -d {db['target']['db_database_name']} --clean --if-exists --single-transaction --exit-on-error --format directory -vv {dump_path}' cmd = " && /\n ".join([pg_dump_cmd, pg_restore_cmd]) self.query_one(Log).write_line("The following migration commands will be executed:\n" + cmd)