RenaiApp/src/main/entities/copyType.ts

27 lines
514 B
TypeScript

import { Column, Entity, ManyToOne } from 'typeorm';
import { Base } from './bases/base';
import { Copy } from './copy';
const enum CopyTypes {
ORIGINAL,
TRANSLATED,
UNCENSORED,
OTHER,
}
@Entity()
export class CopyType extends Base {
@ManyToOne(() => 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;
}