import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm"; import { communication } from "./communication"; @Entity() export class communicationType { @PrimaryColumn({ generated: "increment", type: "int" }) id: number; @Column({ type: "varchar", length: 255 }) type: string; @Column({ type: "varchar", length: 255, default: "", transformer: { from(value: string): Array { return value.split(","); }, to(value: Array): string { return value.join(","); }, }, }) useColumns: Array; @OneToMany(() => communication, (communication) => communication.type) communications: communication[]; }