title: Generating migration file for a project using NestJS and TypeORM
body: <p>I'm trying to generate migration files for my entities, but whenever I run the command to create the entity, it creates an &quot;empty&quot; file, just the up and down methods are created.</p>
  <p>I have added this script in my package.json file: <code>&quot;typeorm&quot;: &quot;node --require ts-node/register ./node_modules/typeorm/cli.js&quot;</code>.</p>
  <p>In my app.module.ts, the connection is configured like this:</p>
  <pre><code> TypeOrmModule.forRoot({
        type: 'mysql',
        host: database().host,
        port: parseInt(database().port),
        username: database().username,
        password: database().password,
        database: database().schema,
        entities: [Question, QuestionOption],
        migrations: ['src/migration/*{.ts,.js}'],
        cli: {
          migrationsDir: 'src/migration'
        },
        synchronize: true,
      })
  </code></pre>
  <p>Where <code>database()</code> it's a nestjs config file and get the values from an .env file.</p>
  <p>The script I'm using to create the migration is: <code>npm run typeorm migration:create -- -n QuestionTables -d src/migrations</code> where need to specify the <strong>-d</strong>, otherwise the migration file is not created (even if it's specified in the cli of the forRoot method.</p>
  <p>Do I need to write manually the SQL to create the tables?</p>
  <p>What if I need to add a new column to an existing table, should I create a new migration file and write manually the SQL code to add that?</p>
  <p>Another command that I tried to run was this one: <code>npm run typeorm migration:generate -- -n QuestionTables -d src/migrations</code> and here it gives me an error: &quot; Error: No connection options were found in any orm configuration files.&quot;</p>