import { SiteName } from './site-name'; import { Source } from './source'; import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; /** * This non-user-maintained entity describes an online provider of works which can be scraped. */ @Entity() export class Site implements IIdentifiableEntity, IMultiNamedEntity { @PrimaryGeneratedColumn() public id: number; @Column({ nullable: false, }) public nameCanonical: string; @OneToMany( () => SiteName, (siteName: SiteName) => siteName.entity ) public names: Promise; /** * sources belonging to this site */ @OneToMany( () => Source, (source: Source) => source.site ) public sources: Promise; }