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
Implemented extra boolean param for rollback() #2968
Conversation
Extra parameter allows all migrations to be rolled back.
test/integration/migrate/index.js
Outdated
}); | ||
|
||
it('should delete all batches from the migration log', function() { | ||
debugger; |
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.
probably this shouldn't be committed :)
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.
Crap, sorry...
test/integration/migrate/index.js
Outdated
}); | ||
}); | ||
|
||
it('should delete all batches from the migration log', function() { |
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.
why not use arrow function?
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.
Because of this?
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.
well yeah when it's needed, but when it's not?..
test/integration/migrate/index.js
Outdated
true | ||
) | ||
.spread(function(batchNo, log) { | ||
console.log(`Batch ${batchNo}, log: ${JSON.stringify(log)}`); |
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.
is this needed?
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.
Oops, sorry.
@@ -829,7 +829,7 @@ declare namespace Knex { | |||
interface Migrator { | |||
make(name: string, config?: MigratorConfig): Bluebird<string>; | |||
latest(config?: MigratorConfig): Bluebird<any>; | |||
rollback(config?: MigratorConfig): Bluebird<any>; | |||
rollback(config?: MigratorConfig, all?: boolean): Bluebird<any>; |
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.
haha, nice touch!
Could you also create a PR in documentation repo? |
LGTM, we can merge it after documentation is created. |
@kibertoad Great! The docs PR is at knex/documentation#170 |
Thank you a lot! |
Extra parameter allows all migrations to be rolled back.
Addresses #2844