title: Duplicate column name with TypeORM in Nestjs
body: <p>We have 2 entities: <code>EstateIntegrationEntity</code> and <code>EstateEntity</code></p>
  <p>When we try to use <code>.findOne</code> on the <code>estateIntegrationRepository</code> we get the following error:</p>
  <pre class="lang-sh prettyprint-override"><code>[Nest] 5537   - 10/01/2020, 8:37:55 AM
  [ExceptionsHandler] ER_DUP_FIELDNAME: Duplicate column name 'EstateIntegrationEntity_estate_id' +1590ms
  QueryFailedError: ER_DUP_FIELDNAME: Duplicate column name 'EstateIntegrationEntity_estate_id'
      at ...
  </code></pre>
  <p>We created a <code>OneToOne</code> relation from the <code>EstateIntegrationEntity</code> to the <code>EstateEntity</code>.</p>
  <pre><code>import { EstateEntity } from &quot;src/estates/estate.entity&quot;;
  import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn, RelationId } from &quot;typeorm&quot;;
  
  @Entity({ name: 'estate_integrations' })
  export class EstateIntegrationEntity {
    @PrimaryGeneratedColumn()
    id: number;
  
    @RelationId((estateIntegrationEntity: EstateIntegrationEntity) =&gt; estateIntegrationEntity.estate)
    estate_id: number;
  
    @OneToOne(() =&gt; EstateEntity, { eager: true })
    @JoinColumn({ name: 'estate_id' })
    estate: EstateEntity;
  
    ...
  }
  </code></pre>
  <p>And a relation from the <code>EstateEntity</code> to the <code>EstateIntegrationEntity</code> :</p>
  <pre><code>import { EstateIntegrationEntity } from 'src/integrations/estate.integration.entity';
  import { Column, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
  
  @Entity('estates')
  export class EstateEntity {
    @PrimaryGeneratedColumn()
    id: number;
  
    @Column('varchar' || null)
    uuid: string;
  
    @OneToOne(
      () =&gt; EstateIntegrationEntity,
      estate_integration =&gt; estate_integration.estate,
    )
    estate_integration: EstateIntegrationEntity;
  }
  </code></pre>
  <p>This error only occurs with <code>.findOne()</code> and not with <code>.find()</code>:</p>
  <pre class="lang-js prettyprint-override"><code>async findEstateById(id: string): Promise&lt;EstateIntegrationEntity&gt; {
    return await this.estateIntegrationRepository.findOne({
      where: {
        external_id: id
      }
    });
  }
  </code></pre>