Merge branch 'elhigu-fixed-regression-running-migrations-through-cli'

This commit is contained in:
Rhys van der Waerden 2016-02-15 19:34:24 +11:00
commit ef462f0f2a
2 changed files with 5 additions and 2 deletions

View File

@ -196,7 +196,7 @@ export default class Migrator {
.then(batchNo => {
return this._waterfallBatch(batchNo, migrations, direction)
})
.then(() => this._freeLock())
.tap(() => this._freeLock())
.catch(error => {
var cleanupReady = Promise.resolve();

View File

@ -243,7 +243,10 @@ module.exports = function(knex) {
describe('knex.migrate.rollback', function() {
it('should delete the most recent batch from the migration log', function() {
return knex.migrate.rollback({directory: 'test/integration/migrate/test'}).then(function() {
return knex.migrate.rollback({directory: 'test/integration/migrate/test'}).spread(function(batchNo, log) {
expect(batchNo).to.equal(1);
expect(log).to.have.length(2);
expect(log[0]).to.contain('test/integration/migrate/test');
return knex('knex_migrations').select('*').then(function(data) {
expect(data.length).to.equal(0);
});