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

31 lines
613 B
TypeScript

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