-
-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added --from and --to support for db:migrate #581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good addition to CLI, needs a bit more verification in tests .
test/db/migrate.test.js
Outdated
expect(tables).to.have.length(3); | ||
expect(tables).to.contain('User'); | ||
runCli('db:migrate --to ' + createTriggers, err => { | ||
done(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For proper verification, check for containment of No migrations were executed, database schema was already up to date.
and error code 0 here
@sushantdhiman Extended tests to include what you requested |
test/db/migrate.test.js
Outdated
expect(tables).to.contain('Post'); | ||
expect(tables).to.contain('trigger_test'); | ||
runCli('db:migrate --from ' + createPost, err => { | ||
done(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add same check here
@sushantdhiman I haven't initially added checks for --from migrations because it wasn't throwing any errors unlike --to. Latest commit introduces that check too |
This reverts commit 4a7e6c4.
Move API error handling into the commands
Enables underlying umzug functionality