2020-04-10 04:04:13 +02:00
|
|
|
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
2020-04-10 05:02:19 +02:00
|
|
|
import { WorkCharacter } from './work-character';
|
2020-04-10 04:04:13 +02:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class WorkCharacterName implements IIdentifiableEntity, INameEntity {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
public id: number;
|
|
|
|
|
2020-04-10 05:12:14 +02:00
|
|
|
@ManyToOne(() => WorkCharacter, (workCharacter: WorkCharacter) => workCharacter.names, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: 'CASCADE',
|
|
|
|
onUpdate: 'CASCADE',
|
|
|
|
})
|
2020-04-10 04:04:13 +02:00
|
|
|
public entity: Promise<WorkCharacter>;
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
nullable: false,
|
|
|
|
})
|
|
|
|
public name: string;
|
|
|
|
}
|