22 lines
581 B
TypeScript
22 lines
581 B
TypeScript
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { WorldCharacter } from './world-character';
|
|
|
|
@Entity()
|
|
export class WorldCharacterName implements IdentifiableEntityInterface, NameEntityInterface {
|
|
@PrimaryGeneratedColumn()
|
|
public id!: number;
|
|
|
|
@ManyToOne(() => WorldCharacter, (worldCharacter: WorldCharacter) => worldCharacter.names, {
|
|
nullable: false,
|
|
onDelete: 'CASCADE',
|
|
onUpdate: 'CASCADE',
|
|
})
|
|
public entity!: Promise<WorldCharacter>;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
default: '',
|
|
})
|
|
public name!: string;
|
|
}
|