title: TypeORM Migrations run, can't seed (no connections?! in migration)
body: <p>I am working on my first TypeScript project, which is based off of this template:
  <a href="https://github.com/ljlm0402/typescript-express-starter" rel="nofollow noreferrer">https://github.com/ljlm0402/typescript-express-starter</a></p>
  <p>I am working on adding migrations to our app, up to this point we have been relying on the automigration functionality and dropping / recreating DB/Tables as entities are updated. We would like to add a &quot;default user&quot; to our system via the migrations... but because of the way the app is running the up/down functions in the migration for some reason CAN create/drop tables but CAN NOT access any of these tables to insert data into them (??!!).</p>
  <p>I am worried it may be a .env / ormconfig.js issue, and also the layer of how TS is compiled to JS makes me worry that for some reason my app is not reading the right config file.</p>
  <p>How to reproduce this:</p>
  <p><code>ts-node ./node_modules/typeorm/cli.js --config ./ormconfig.js &quot;migration:run&quot;</code></p>
  <p>ormconfig.js:</p>
  <pre><code>const env = process.env.NODE_ENV || 'development';
  
  module.exports = {
    type: 'postgres',
    host: process.env.POSTGRESQL_HOST,
    port: process.env.POSTGRESQL_PORT,
    username: process.env.POSTGRESQL_USERNAME,
    password: process.env.POSTGRESQL_PASSWORD,
    database: process.env.POSTGRESQL_DATABASE,
    synchronize: true,
    logging: false,
    entities: [env === 'production' ? 'build/entity/*{.ts,.js}' : 'src/entity/*{.ts,.js}'],
    migrations: [env === 'production' ? 'build/migration/*{.ts,.js}' : 'src/migration/*{.ts,.js}'],
    subscribers: [env === 'production' ? 'build/subscriber/*{.ts,.js}' : 'src/subscriber/*{.ts,.js}'],
    cli: {
      entitiesDir: 'src/entity',
      migrationsDir: 'src/migration',
      subscribersDir: 'src/subscriber',
    },
  };
  </code></pre>
  <p>Migration (trimmed for brevity)</p>
  <pre><code>import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
  import userService from '../services/user.service';
  
  export class SeedDefaultUser1610084649009 implements MigrationInterface {
    
    public userService = new userService();
  
    public async up(queryRunner: QueryRunner): Promise&lt;void&gt; {
  
      const dbs = await queryRunner.getDatabases(); // returns empty array []
      const schemas = await queryRunner.getSchemas(); // returns empty array []
      console.log(dbs, schemas);
  
      await queryRunner.createTable(
        new Table({
          name: 'user_entity',
          columns: [
            {
              name: 'id',
              type: 'int',
              isPrimary: true,
            },
            {
              name: 'email',
              type: 'varchar',
            },
          ],
        }),
        true,
      ); // Despite no db connections, this works! tables exist!   
  
      const user: User = await this.userService.create(
        {
          email: 'admin@email.com',
        },
      ); // This fails with:
         //QueryFailedError: relation &quot;user_entity&quot; does not exist
  
    }
  
    public async down(queryRunner: QueryRunner): Promise&lt;void&gt; {}
  }
  </code></pre>