Skip to content

Commit f9c7ef6

Browse files
author
Anson Tsao
committed
Ensure scoped migration created in subdirectory
1 parent bd165a5 commit f9c7ef6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/commands/create-migration.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function executeCreateMigration (internals, config) {
5151
internals.argv.title = internals.argv._.shift();
5252
folder = internals.argv.title.split('/');
5353

54-
internals.argv.title = folder[folder.length - 2] || folder[0];
54+
internals.argv.title = folder[folder.length - 1] || folder[0];
5555
path = migrationsDir;
5656

5757
if (folder.length > 1) {
@@ -61,6 +61,7 @@ async function executeCreateMigration (internals, config) {
6161
path += folder[i] + '/';
6262
}
6363
}
64+
internals.argv['migrations-dir'] = path
6465

6566
let templateType = Migration.TemplateType.DEFAULT_JS;
6667
if (

0 commit comments

Comments
 (0)