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