message: forgive node-pg-migrate migration already running errors
diff: @@ -31,12 +31,26 @@ module.exports = class TransactionIndex {
  if (this._didEnsureDatabaseSetup) { return; }
  if (!this._migrateDbPromise) {
  + let hasMigrationErrors = false;
  + do {
  + try {
  this._migrateDbPromise = this._migrateDb();
  + } catch (err) {
  + // its really tricky to coordinate this across separate EC2 instances, so keep trying
  + if (err.message.includes('Another migration is already running')) {
  + hasMigrationErrors = true;
  + await sleep(1000);
  + } else {
  + throw err;
  + }
  }
  + } while (hasMigrationErrors);
  +
  await this._migrateDbPromise;
  this._didEnsureDatabaseSetup = true;
  }
  + }
  async _migrateDb() {
  let client = new Client(Object.assign({}, config, { database: 'postgres' }));
  