Skip to content

Commit c4e53b1

Browse files
committed
fix: print correct migration name #663
1 parent 0985c23 commit c4e53b1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/commands/model_generate.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ exports.handler = function (args) {
4242
);
4343
helpers.view.log(
4444
'New migration was created at',
45-
clc.blueBright(helpers.path.getMigrationPath(args.name)),
45+
clc.blueBright(
46+
helpers.path.getMigrationPath(
47+
helpers.migration.generateMigrationName(args)
48+
)
49+
),
4650
'.'
4751
);
4852

test/model/create.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ const _ = require('lodash');
119119
{
120120
flags: { name: 'User', attributes },
121121
},
122-
() => {
122+
(err, stdout) => {
123+
expect(stdout).to.match(/New model was created at .*user.js/);
123124
gulp
124125
.src(Support.resolveSupportPath('tmp', 'models'))
125126
.pipe(helpers.listFiles())
@@ -162,7 +163,10 @@ const _ = require('lodash');
162163
{
163164
flags: { name: 'User', attributes },
164165
},
165-
() => {
166+
(err, stdout) => {
167+
expect(stdout).to.match(
168+
/New migration was created at .*create-user.js/
169+
);
166170
gulp
167171
.src(Support.resolveSupportPath('tmp', 'migrations'))
168172
.pipe(helpers.listFiles())

0 commit comments

Comments
 (0)