Skip to content

Commit 1a0f10f

Browse files
chore(db-migrations): using string interpolation, simplifying results gathering
1 parent 1a5cda0 commit 1a0f10f

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/db-migrations/bin/patcher.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ for (const db of databases) {
4242
);
4343
try {
4444
const cfg = conf.get(db);
45-
console.log('Patching', db, 'to', level);
46-
await patch({
45+
console.log(`Patching ${db} to ${level}`);
46+
let results = await patch({
4747
user: cfg.user,
4848
password: cfg.password,
4949
host: cfg.host,
@@ -56,14 +56,13 @@ for (const db of databases) {
5656
createDatabase: true,
5757
reversePatchAllowed: false,
5858
database: cfg.database,
59-
}, function(err, res) {
60-
console.log('Results:', res)
6159
});
62-
console.log('Successfully patched', db, 'to', level);
60+
console.log(`Results: ${results}`);
61+
console.log(`Successfully patched ${db} to ${level}`);
6362
} catch (error) {
6463
// fyi these logs show up in `pm2 logs mysql`
65-
console.error('Error:',error);
66-
console.error('Failed to patch', db, 'to', level);
64+
console.error(`Error: ${error}`);
65+
console.error(`Failed to patch ${db} to ${level}`);
6766
process.exit(2);
6867
}
6968
}

0 commit comments

Comments
 (0)