import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'; import { Collection } from './collection'; @Entity() export class CollectionName implements IIdentifiableEntity, INameEntity { @PrimaryGeneratedColumn() public id: number; @ManyToOne(() => Collection, (collection: Collection) => collection.names, { nullable: false, onDelete: 'CASCADE', onUpdate: 'CASCADE', }) public entity: Promise; @Column({ nullable: false, }) public name: string; }