Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Child Entities cause duplication of columns on a table #55

Open
hartjus opened this issue Aug 31, 2022 · 0 comments
Open

Child Entities cause duplication of columns on a table #55

hartjus opened this issue Aug 31, 2022 · 0 comments

Comments

@hartjus
Copy link

hartjus commented Aug 31, 2022

If you utilize the @ChildEntity(someEnum.VALUE) feature of TypeORM on one or more entities, the diagram it creates for the table is incorrect. You will see the columns duplicated on the table in the diagram.

Parent class:

@Entity('table_name')
@TableInheritance({
  column: { type: 'enum', enum: SomeEnum, name: 'type' },
})
export abstract class TableEntity {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ type: 'text', nullable: true })
  name: string | null;
  ...

Child class:

@ChildEntity(SomeEnum.VALUE)
export class ChildEntity extends TableEntity {
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant