typeorm-uml
typeorm-uml copied to clipboard
Child Entities cause duplication of columns on a table
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 {
...