21 lines
472 B
TypeScript
21 lines
472 B
TypeScript
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { World } from './world';
|
|
|
|
@Entity()
|
|
export class WorldName implements IIdentifiableEntity, INameEntity {
|
|
@PrimaryGeneratedColumn()
|
|
public id: number;
|
|
|
|
@ManyToOne(() => World, (world: World) => world.names, {
|
|
nullable: false,
|
|
onDelete: 'CASCADE',
|
|
onUpdate: 'CASCADE',
|
|
})
|
|
public entity: Promise<World>;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
})
|
|
public name: string;
|
|
}
|