import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { CollectionName } from './collection-name'; import { CollectionPart } from './collection-part'; @Entity() export class Collection implements CollectionEntityInterface { @PrimaryGeneratedColumn() public readonly id!: number; @Column({ nullable: false, default: '', }) public nameCanonical!: string; @OneToMany(() => CollectionName, (collectionName: CollectionNameEntityInterface) => collectionName.entity) public names!: Promise; @OneToMany(() => CollectionPart, (collectionPart: CollectionPartEntityInterface) => collectionPart.collection) public parts!: Promise; }