Can't take lock to run migrations: Migration table is already locked If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock' code example

Example 1: Can't take lock to run migrations: Migration table is already locked If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock'

beforeEach(function() {
  return knex.migrate.rollback()
    .then(function() {
      return knex.migrate.latest();
    })
    .then(function() {
      return knex.seed.run();
    });
});

Example 2: Can't take lock to run migrations: Migration table is already locked If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock'

DROP TABLE knex_migrations_lock || DELETE FROM knex_migrations_lock

Example 3: Can't take lock to run migrations: Migration table is already locked If you are sure migrations are not running you can release the lock manually by running 'knex migrate:unlock'

beforeEach(async function () {
  this.timeout(60 * 1000)
  await knex.migrate.rollback()
  await knex.migrate.latest()
  return knex.seed.run()
})