title: TypeError: Cannot read properties of undefined (reading 'joinColumns')
body: <p>I have two entities <code>Document</code> and <code>DocumentVersion</code>, they have a one to many relation (one <code>Document</code> has many <code>DocumentVersions</code>).</p>
  <p>Document:</p>
  <pre class="lang-js prettyprint-override"><code>@Entity()
  @TableInheritance({ column: { type: 'varchar', name: 'type' } })
  export class Document {
      @PrimaryGeneratedColumn()
      id: number;
  
      @Column()
      name: string;
  
      @OneToMany(() =&gt; DocumentVersion, version =&gt; version.document)
      versions: DocumentVersion[];
  
      ...
  }
  </code></pre>
  <p>DocumentVersion:</p>
  <pre class="lang-js prettyprint-override"><code>@Entity()
  @TableInheritance({ column: { type: 'varchar', name: 'type' } })
  export class DocumentVersion {
      @PrimaryGeneratedColumn()
      id: number;
  
      @Column()
      isAuthorUpdate: boolean;
  
      @ManyToOne(() =&gt; Document, document =&gt; document.versions)
      document: Document;
  
      ...
  }
  </code></pre>
  <p>I am using NestJS with Typeorm and when I call <code>repo.find({ relations: { versions: true }})</code>, I get the following error:</p>
  <blockquote>
  <p>TypeError: Cannot read properties of undefined (reading 'joinColumns')</p>
  </blockquote>
  <p>From my research it seems that error occurs when both sides of the relations are not defined (i.e. only the @ManyToOne side is defined), but I have both sides defined.</p>
  <p>The underlying database is Postgres if that matters.</p>