title: TypeORM how to use one foreign key column for two properties for one to one relation?
body: <p>In nest.js typeorm entity my class has two properties. In database it creates two columns pickUpId and dropOffId in Location table in database. So, for every package two rows are creates in locations are created. For pickUp dropOffId remains null and for dropOff pickUpId remains null in table. Is there a way to reference same column to be used by both properties? For example, how can I use pickUpOrDropOffId column and point to both dropOff and pickUp properties?</p>
  <p>PackageEntity:</p>
  <pre><code> @OneToOne(() =&gt; LocationEntity, (pickUp) =&gt; pickUp.pickUp, {
      cascade: true,
    })
    @Field(() =&gt; LocationEntity)
    pickUp: LocationEntity;
  
    @OneToOne(() =&gt; LocationEntity, (dropOff) =&gt; dropOff.dropOff, {
      cascade: true,
    })
    @Field(() =&gt; LocationEntity)
    dropOff: LocationEntity;
  </code></pre>
  <p>LocationEntity:</p>
  <pre><code>@OneToOne(() =&gt; LoadEntity, (load) =&gt; load.pickUp, {
      onDelete: 'CASCADE',
    })
    @JoinColumn()
    pickUp: PackageEntity;
  
    @OneToOne(() =&gt; LoadEntity, (load) =&gt; load.dropOff, {
      onDelete: 'CASCADE',
    })
    @JoinColumn()
    dropOff: PackageEntity;
  </code></pre>