title: TypeORM problem saving entity with cascade true
body: <p>I m using NestJS with TypeORM and I m trying to save a user conversation with messages. I set the messages field on the conversation entity to <strong><em>cascade: true</em></strong>. But When I try this code:</p>
  
  <pre><code>const user3: User = { login: 'admin', createdBy: 'system', lastModifiedBy: 'system' };
  const user4: User = { login: 'user', createdBy: 'system', lastModifiedBy: 'system' };
  const message1: Message = { content: 'Hello How are you? ', createdBy: user3.login, lastModifiedBy: user3.login };
  const conversation1: Conversation = { sender: user3, reciever: user4, messages: [message1] };
  getConnection().getRepository(Conversation).save(conversation1);
  </code></pre>
  
  <p>It creates this query:</p>
  
  <pre><code>INSERT INTO "message"("id", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate", "content", "conversationSenderId", "conversationRecieverId", "conversationDate") VALUES (?, ?, datetime('now'), ?, datetime('now'), ?, ?, ?, ?)
  -- PARAMETERS: ["67348880-6897-47cb-92ef-5f66ffb2e88c","admin","admin","Hello How are you? ","b2420445-c8ee-4080-86b3-98ab12ef576b","09f3672d-9b2f-4f68-b47e-a7ca5d806ec6","2019-10-24 14:41:40.000"]
  </code></pre>
  
  <p>with this error:</p>
  
  <pre><code>{ [Error: SQLITE_CONSTRAINT: FOREIGN KEY constraint failed] errno: 19, code: 'SQLITE_CONSTRAINT' }
  </code></pre>
  
  <p>I can see it's a problem with the foreign key of messages table but I can't fix it because it's TypeORM library which handle the creation, not me.
  I searched on internet (documentation, github, stackoverflow) without success.
  I think it's bug in TypeORM library but I m a novice in it so I prefer asking if I did something wrong</p>
  
  <p>Here are my entities :</p>
  
  <pre><code>export abstract class BaseEntity {
    @ObjectIdColumn()
    @PrimaryGeneratedColumn('uuid')
    id?: string;
  
    @Column()
    createdBy?: string;
  
    @CreateDateColumn()
    createdDate?: Date;
  
    @Column()
    lastModifiedBy?: string;
  
    @UpdateDateColumn()
    lastModifiedDate?: Date;
  }
  
  @Entity('user')
  export class User extends BaseEntity {
    @Column()
    login?: string;
  
    @OneToMany(type =&gt; Conversation, conversation =&gt; conversation.sender)
    sentConversations?: Conversation[];
  
    @OneToMany(type =&gt; Conversation, conversation =&gt; conversation.reciever)
    recievedConversations?: Conversation[];
  }
  
  @Entity()
  export class Conversation {
    @PrimaryColumn()
    senderId?: string;
  
    @PrimaryColumn()
    recieverId?: string;
  
    @CreateDateColumn({ primary: true })
    date?: Date;
  
    @OneToMany(type =&gt; Message, message =&gt; message.conversation, { cascade: true })
    messages: Message[];
  
    @ManyToOne(type =&gt; User, user =&gt; user.sentConversations)
    @JoinColumn({ name: 'senderId' })
    sender?: User;
  
    @ManyToOne(type =&gt; User, user =&gt; user.recievedConversations)
    @JoinColumn({ name: 'recieverId' })
    reciever?: User;
  }
  
  @Entity('message')
  export class Message extends BaseEntity {
    @Column({ length: 10000 })
    content: string;
  
    @ManyToOne(type =&gt; Conversation, conversation =&gt; conversation.messages)
    conversation?: Conversation;
  }
  </code></pre>
  
  <p>In this repository, you will be able to reproduce the bug: 
  <a href="https://github.com/youtix/nest-typerorm-test" rel="noreferrer">https://github.com/youtix/nest-typerorm-test</a></p>