Skip to content

Commit

Permalink
fix: log message when sql migration is performed (#1942)
Browse files Browse the repository at this point in the history
* fix: log message when sql migration is performed

* chore: bump api-toolkit
  • Loading branch information
zone117x authored Apr 12, 2024
1 parent 73ec0db commit 49a4d25
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "9.0.9",
"@hirosystems/api-toolkit": "1.3.3",
"@hirosystems/api-toolkit": "1.5.0",
"@promster/express": "6.0.0",
"@promster/server": "6.0.6",
"@promster/types": "3.2.3",
Expand Down
13 changes: 12 additions & 1 deletion src/datastore/pg-write-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,18 @@ export class PgWriteStore extends PgStore {
connectionConfig: getConnectionConfig(PgServer.primary),
});
if (!skipMigrations) {
await runMigrations(MIGRATIONS_DIR, 'up', getConnectionArgs(PgServer.primary));
await runMigrations(MIGRATIONS_DIR, 'up', getConnectionArgs(PgServer.primary), {
logger: {
debug: _ => {},
info: msg => {
if (msg.includes('Migrating files')) {
logger.info(`Performing SQL migration, this may take a while...`);
}
},
warn: msg => logger.warn(msg),
error: msg => logger.error(msg),
},
});
}
const notifier = withNotifier ? await PgNotifier.create(usageName) : undefined;
const store = new PgWriteStore(sql, notifier, isEventReplay);
Expand Down

0 comments on commit 49a4d25

Please sign in to comment.