2019-06-23 02:30:24 +02:00
|
|
|
import { Column, Entity, ManyToOne } from 'typeorm';
|
|
|
|
import { Base } from './bases/base';
|
|
|
|
import { Copy } from './copy';
|
|
|
|
|
|
|
|
const enum CopyTypes {
|
2019-06-23 15:35:57 +02:00
|
|
|
ORIGINAL = 'original',
|
|
|
|
TRANSLATED = 'translated',
|
|
|
|
UNCENSORED = 'uncensored',
|
|
|
|
OTHER = 'other',
|
2019-06-23 02:30:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@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;
|
|
|
|
}
|