Skip to content

Commit 61ca5bb

Browse files
committed
fix(reset): regression introduced in check functionality
db-migrate#552 introduced a regression and effectively disfunctioned the reset function, since it did append just to the actionables within the run context. It was moved into its own context. Signed-off-by: Tobias Gurtzick <[email protected]>
1 parent 6144472 commit 61ca5bb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/commands/run.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function run (internals, config) {
4242
break;
4343
case 'up':
4444
case 'down':
45-
case 'check':
4645
case 'reset':
4746
if (action === 'reset') internals.argv.count = Number.MAX_VALUE;
4847

@@ -63,15 +62,22 @@ function run (internals, config) {
6362
if (action === 'up') {
6463
var executeUp = load('up');
6564
executeUp(internals, config);
66-
} else if (action === 'down') {
65+
} else {
6766
var executeDown = load('down');
6867
executeDown(internals, config);
69-
} else {
70-
var executeCheck = load('check');
71-
executeCheck(internals, config);
7268
}
7369
break;
7470

71+
case 'check':
72+
var executeCheck = load('check');
73+
74+
if (folder[1]) {
75+
internals.matching = folder[1];
76+
internals.migrationMode = folder[1];
77+
}
78+
79+
executeCheck(internals, config);
80+
break;
7581
case 'db':
7682
if (folder.length < 1) {
7783
log.info('Please enter a valid command, i.e. db:create|db:drop');

0 commit comments

Comments
 (0)