RenaiApp/src/main/entities/library/copy-type.ts

27 lines
575 B
TypeScript

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<Copy>;
@Column({ nullable: false })
public type: CopyTypes;
@Column({ nullable: true })
public comment: string;
}