- // eslint-disable-next-line security/detect-non-literal-fs-filename
- const fSql = fs.readFileSync(fPath, { encoding: 'utf8' });
- this.logger.info(_scope, 'applying migration', { version: v });
- this.db.exec(fSql);
+ try {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
+ const fSql = fs.readFileSync(fPath, { encoding: 'utf8' });
+ this.logger.debug(_scope, 'applying migration', { version: v });
+ const results = this.db.exec(fSql);
+ this.logger.debug(_scope, 'migration results', { results });
+ this.logger.info(_scope, 'applied migration', { version: v });
+ } catch (e) {
+ this.logger.error(_scope, 'migration failed', { error: e, fPath, version: v });
+ throw e;
+ }