title: how to use onDelete: 'CASCADE' on TypeORM
body: <p>I have 2 migrations Users and Posts and Posts has a <code>onDelete: 'CASCADE'</code>. For some reason when I delete a User with a Posts it throws an error saying:</p>
  
  <p><code>"Cannot delete or update a parent row: a foreign key constraint fails (</code>development_db<code>.</code>posts<code>, CONSTRAINT</code>posts_ibfk_1<code>FOREIGN KEY (</code>userId<code>) REFERENCES</code>users<code>(</code>id<code>))",</code></p>
  
  <p>but I already set my Posts entity to <code>onDelete: 'CASCADE'</code>. What trips me off is when I add <code>ON DELETE CASCADE</code> on my posts migration the cascade delete works even though I removed <code>onDelete: 'CASCADE'</code> on my posts model. Any idea? so what's the use of <code>onDelete</code> in typeorm when you can set it on migration and not on the entity but still works.</p>
  
  <p>USER Migration:</p>
  
  <pre><code>/* eslint-disable class-methods-use-this */
  import { MigrationInterface, QueryRunner } from 'typeorm';
  
  export class UsersTable1575433829516 implements MigrationInterface {
    public async up(queryRunner: QueryRunner): Promise&lt;any&gt; {
      await queryRunner.query(`
              CREATE TABLE users (
                id INT AUTO_INCREMENT,
                username VARCHAR(50) NOT NULL,
                email VARCHAR(50) NOT NULL UNIQUE,
                password VARCHAR(255) NOT NULL,
                createdAt DATETIME NOT NULL,
                PRIMARY KEY(id)
              );
          `);
    }
  
    public async down(queryRunner: QueryRunner): Promise&lt;any&gt; {
      await queryRunner.dropTable('users', true);
    }
  }
  </code></pre>
  
  <p>POST Migration:</p>
  
  <pre><code>/* eslint-disable class-methods-use-this */
  import { MigrationInterface, QueryRunner } from 'typeorm';
  
  export class PostsTable1581617587575 implements MigrationInterface {
    public async up(queryRunner: QueryRunner): Promise&lt;any&gt; {
      await queryRunner.query(`
          CREATE TABLE posts (
            id INT AUTO_INCREMENT,
            title VARCHAR(255) NOT NULL,
            body TEXT(65000) NOT NULL,
            createdAt DATETIME NOT NULL,
            updatedAt DATETIME,
            PRIMARY KEY(id),
            userId INT NOT NULL,
            FOREIGN KEY (userId) 
                    REFERENCES users (id)
          );
      `);
    }
  
    public async down(queryRunner: QueryRunner): Promise&lt;any&gt; {
      await queryRunner.dropTable('posts', true);
    }
  }
  </code></pre>