import { Column, Entity, ManyToOne } from 'typeorm'; import { Base } from './bases/base'; import { Copy } from './copy'; const enum CopyTypes { ORIGINAL = 'original', TRANSLATED = 'translated', UNCENSORED = 'uncensored', OTHER = 'other', } @Entity() export class CopyType extends Base { @ManyToOne(() => Copy, (copy: Copy) => copy.types, { nullable: false, onDelete: 'CASCADE', onUpdate: 'CASCADE', }) public copy: Promise; @Column({ nullable: false }) public type: CopyTypes; @Column({ nullable: true }) public comment: string; }