Skip to content

Commit 8846ef9

Browse files
Tom KirkpatrickTom Kirkpatrick
authored andcommitted
fix: migrationsDir should accept relative path [#9]
1 parent 416245a commit 8846ef9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/models/migration.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ module.exports = function(Migration, options) {
116116
// include the script, run the up/down function, update the migrations table, and continue
117117
migrationStartTime = process.hrtime();
118118
Migration.log.info(localScriptName, 'running.');
119-
require(path.join(Migration.migrationsDir, localScriptName))[upOrDown](Migration.app, function(err) {
119+
const scriptPath = path.resolve(path.join(Migration.migrationsDir, localScriptName));
120+
require(scriptPath)[upOrDown](Migration.app, function(err) {
120121
if (err) {
121122
Migration.log.error(localScriptName, 'error:');
122123
Migration.log.error(err.stack);

0 commit comments

Comments
 (0)