RenaiApp/src/main/entities/library/work-character-name.ts

21 lines
537 B
TypeScript
Raw Normal View History

import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { WorkCharacter } from './work-character';
@Entity()
export class WorkCharacterName implements IIdentifiableEntity, INameEntity {
@PrimaryGeneratedColumn()
public id: number;
@ManyToOne(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.names, {
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
})
public entity: Promise<WorkCharacter>;
@Column({
nullable: false,
})
public name: string;
}