Skip to content

Commit

Permalink
fix: print correct migration name #663
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantdhiman committed Jun 21, 2020
1 parent 0985c23 commit c4e53b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/commands/model_generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ exports.handler = function (args) {
);
helpers.view.log(
'New migration was created at',
clc.blueBright(helpers.path.getMigrationPath(args.name)),
clc.blueBright(
helpers.path.getMigrationPath(
helpers.migration.generateMigrationName(args)
)
),
'.'
);

Expand Down
8 changes: 6 additions & 2 deletions test/model/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ const _ = require('lodash');
{
flags: { name: 'User', attributes },
},
() => {
(err, stdout) => {
expect(stdout).to.match(/New model was created at .*user.js/);
gulp
.src(Support.resolveSupportPath('tmp', 'models'))
.pipe(helpers.listFiles())
Expand Down Expand Up @@ -162,7 +163,10 @@ const _ = require('lodash');
{
flags: { name: 'User', attributes },
},
() => {
(err, stdout) => {
expect(stdout).to.match(
/New migration was created at .*create-user.js/
);
gulp
.src(Support.resolveSupportPath('tmp', 'migrations'))
.pipe(helpers.listFiles())
Expand Down

0 comments on commit c4e53b1

Please sign in to comment.