title: Knex migration command result in error: Timeout acquiring a connection
body: <p>I'm building a backend project with Docker as my environment plus</p>
  <ul>
  <li>Node 17+</li>
  <li>Knex ^1.0.1</li>
  <li>PG ^8.7.1</li>
  <li>PostgreSQL 14.1-alpine</li>
  </ul>
  <p>I was able to connect to my DB via a GUI as <strong>Table Plus</strong> and <strong>DB Beaver</strong>.
  I also was able to use the <code>knex migrate:make</code> command to create the migration.</p>
  <p>I followed some online and here suggestions to avoid this issue but I was unable to make it work.</p>
  <p>Looks like I did a code mistake maybe.
  No clue what's wrong right now.</p>
  <p>Now the issue is with the command to migrate <code>knex migrate:latest</code> resulting as error</p>
  <pre class="lang-sh prettyprint-override"><code>Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
  KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
      at Client_PG.acquireConnection (/Users/jakub/Desktop/jakeDev/test/node_modules/knex/lib/client.js:307:26)
      at async Runner.ensureConnection (/Users/jakub/Desktop/jakeDev/test/node_modules/knex/lib/execution/runner.js:294:28)
      at async Runner.run (/Users/jakub/Desktop/jakeDev/test/node_modules/knex/lib/execution/runner.js:30:19)
      at async listCompleted (/Users/jakub/Desktop/jakeDev/test/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js:12:3)
      at async Promise.all (index 1)
      at async Migrator.latest (/Users/jakub/Desktop/jakeDev/test/node_modules/knex/lib/migrations/migrate/Migrator.js:63:29)
      at async Command.&lt;anonymous&gt; (/Users/jakub/Desktop/jakeDev/test/node_modules/knex/bin/cli.js:232:32)
  </code></pre>
  <p>The way I configured Knex</p>
  <pre><code>const development = {
    client: 'pg',
    connection: {
      host: config.POSTGRES_HOST,
      database: config.POSTGRES_DB,
      user: config.POSTGRES_USER,
      password: config.POSTGRES_PASSWORD,
    },
    pool: {
      min: 0,
      max: 50,
      createTimeoutMillis: 3000,
      acquireTimeoutMillis: 30000,
      idleTimeoutMillis: 30000,
      reapIntervalMillis: 1000,
      createRetryIntervalMillis: 100,
      propagateCreateError: false,
    },
    migrations: {
      directory: './src/database/migrations',
    },
  };
  </code></pre>
  <p>And my migration setup</p>
  <pre><code>import tableNames from '../../constants/tableNames';
  import { createTableName } from '../../utils/tableUtils.js';
  
  /**
   * @param { import(&quot;knex&quot;).Knex } knex
   * @returns { Promise&lt;void&gt; }
   */
  export async function up(knex) {
    await Promise.all([
      createTableName(knex, tableNames.pokemons),
      createTableName(knex, tableNames.restoredPokeDex),
    ]);
  }
  
  /**
   * @param { import(&quot;knex&quot;).Knex } knex
   * @returns { Promise&lt;void&gt; }
   */
  export async function down(knex) {
    await Promise.all(
      [tableNames.pokemons, tableNames.restoredPokeDex].map((tableName) =&gt;
        knex.schema.dropTableIfExists(tableName)
      )
    );
  }
  </code></pre>
  <p>I'm importing the following part above</p>
  <pre><code>function tableDefaultColumns(table) {
    table.text('name').notNullable().unique();
    table.text('type_1').notNullable();
    table.text('type_2');
    table.integer('total').notNullable();
    table.integer('hp').notNullable();
    table.integer('attack').notNullable();
    table.integer('defense').notNullable();
    table.integer('sp_atk').notNullable();
    table.integer('sp_def').notNullable();
    table.integer('speed').notNullable();
    table.integer('generation').notNullable();
    table.boolean('legendary').defaultTo(false);
  }
  
  function createTableName(knex, tableName) {
    return knex.schema.createTableName(tableName, (table) =&gt; {
      table.increments().notNullable();
      tableDefaultColumns(table);
    });
  }
  
  export { tableDefaultColumns, createTableName };
  
  </code></pre>