22 lines
632 B
TypeScript
22 lines
632 B
TypeScript
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { SiteName } from './site-name';
|
|
import { Source } from './source';
|
|
|
|
@Entity()
|
|
export class Site implements SiteEntityInterface {
|
|
@PrimaryGeneratedColumn()
|
|
public readonly id!: number;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
default: '',
|
|
})
|
|
public nameCanonical!: string;
|
|
|
|
@OneToMany(() => SiteName, (siteName: SiteNameEntityInterface) => siteName.entity)
|
|
public names!: Promise<SiteNameEntityInterface[]>;
|
|
|
|
@OneToMany(() => Source, (source: SourceEntityInterface) => source.site)
|
|
public sources!: Promise<SourceEntityInterface[]>;
|
|
}
|