title: How to specify ormconfig.ts for TypeORM?
body: <p>I have created a sample TypeORM project using the TypeORM CLI which has ormconfig.json by default:</p>
  <pre><code>{
     &quot;type&quot;: &quot;postgres&quot;,
     &quot;host&quot;: &quot;localhost&quot;,
     &quot;port&quot;: 5432,
     &quot;username&quot;: &quot;postgres&quot;,
     &quot;password&quot;: &quot;postgres&quot;,
     &quot;database&quot;: &quot;test&quot;,
     &quot;synchronize&quot;: false,
     &quot;entities&quot;: [
        &quot;src/entity/**/*.ts&quot;
     ],
     &quot;migrations&quot;: [
        &quot;database/migrations/**/*.ts&quot;
     ],
     &quot;subscribers&quot;: [
        &quot;src/subscriber/**/*.ts&quot;
     ],
     &quot;cli&quot;: {
        &quot;entitiesDir&quot;: &quot;src/entity&quot;,
        &quot;migrationsDir&quot;: &quot;database/migrations&quot;,
        &quot;subscribersDir&quot;: &quot;src/subscriber&quot;
     }
  }
  </code></pre>
  <p>this is the directory structure:</p>
  <pre><code>-database
    -migrations
  -src
    -entity
  -ormconfig.json
  </code></pre>
  <p>This creates the migrations in the database/migrations folder properly as well as executes the migrations from it.</p>
  <p>I replaced ormconfig.json with the following ormconfig.ts :</p>
  <pre><code>export default {
      type: 'postgres',
      host: 'localhost',
      port: 5432,
      username: 'postgres',
      password: 'postgres',
      database: 'test',
      synchronize: false,
      &quot;entities&quot;: [
          &quot;src/entity/**/*.ts&quot;
      ],
      &quot;migrations&quot;: [
           &quot;database/migrations/**/*.ts&quot;
      ],
      &quot;subscribers&quot;: [
          &quot;src/subscriber/**/*.ts&quot;
      ],
      &quot;cli&quot;: {
          &quot;entitiesDir&quot;: &quot;src/entity&quot;,
          &quot;migrationsDir&quot;: &quot;database/migrations&quot;,
          &quot;subscribersDir&quot;: &quot;src/subscriber&quot;
      }
  };
  </code></pre>
  <p>This however creates migrations in the root directory instead of inside database/migrations.</p>
  <p>Can anyone help me in figuring out what's missing here and how I can use ormconfig.ts to generate migrations inside the intended directory?</p>