import { Column, Entity, PrimaryColumn } from "typeorm"; @Entity() export class template { @PrimaryColumn({ generated: "increment", type: "int" }) id: number; @Column({ type: "varchar", length: 255 }) template: string; @Column({ type: "varchar", length: 255, nullable: true }) description?: string; @Column({ type: "text", default: "{}", transformer: { to(value: object) { return JSON.stringify(value); }, from(value: string) { return JSON.parse(value); }, }, }) design: object; @Column({ type: "text", default: "" }) html: string; }