Skip to content

Commit

Permalink
#27: Delete backup is triggered only if migrations are done w/o error…
Browse files Browse the repository at this point in the history
…s or db restored from backup w/o error.
  • Loading branch information
vlavrynovych committed Nov 18, 2023
1 parent a46903e commit 10b1091
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/MigrationScriptExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export class MigrationScriptExecutor {
scripts.executed = await this.execute(scripts.todo);
this.consoleRenderer.drawExecutedTable(scripts.executed);
console.info('Migration finished successfully!');
this.backupService.deleteBackup();
} catch (err) {
console.error(err)
success = false
await this.backupService.restore();
} finally {
this.backupService.deleteBackup();
}
this.exit(success)
Expand Down

0 comments on commit 10b1091

Please sign in to comment.