mirror of
https://github.com/knex/knex.git
synced 2025-10-01 02:56:45 +00:00
Fixed typo and moved LockError emitting to inside _getLock function
This commit is contained in:
parent
d510b2377f
commit
9236ca95e3
@ -169,10 +169,12 @@ export default class Migrator {
|
||||
return this._isLocked(trx)
|
||||
.then(isLocked => {
|
||||
if (isLocked) {
|
||||
throw new Error("Migration table is are already locked");
|
||||
throw new Error("Migration table is already locked");
|
||||
}
|
||||
})
|
||||
.then(() => this._lockMigrations(trx));
|
||||
}).catch(err => {
|
||||
throw new LockError(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
@ -185,9 +187,6 @@ export default class Migrator {
|
||||
// Run a batch of current migrations, in sequence.
|
||||
_runBatch(migrations, direction) {
|
||||
return this._getLock()
|
||||
.catch(err => {
|
||||
throw new LockError(err.message);
|
||||
})
|
||||
.then(() => Promise.all(_.map(migrations, this._validateMigrationStructure, this)))
|
||||
.then(() => this._latestBatchNumber())
|
||||
.then(batchNo => {
|
||||
|
@ -153,7 +153,7 @@ module.exports = function(knex) {
|
||||
});
|
||||
})
|
||||
.catch(function(error) {
|
||||
expect(error).to.have.property('message', 'Migration table is are already locked');
|
||||
expect(error).to.have.property('message', 'Migration table is already locked');
|
||||
return knex('knex_migrations_lock').select('*');
|
||||
})
|
||||
.then(function(data) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user