2020-04-10 05:02:19 +02:00
|
|
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
2020-04-10 04:04:13 +02:00
|
|
|
import { SiteName } from './site-name';
|
2019-06-23 02:30:24 +02:00
|
|
|
import { Source } from './source';
|
|
|
|
|
|
|
|
@Entity()
|
2021-01-24 19:11:45 +01:00
|
|
|
export class Site implements SiteEntityInterface {
|
2020-04-10 04:04:13 +02:00
|
|
|
@PrimaryGeneratedColumn()
|
2021-01-24 19:11:45 +01:00
|
|
|
public readonly id!: number;
|
2020-04-10 04:04:13 +02:00
|
|
|
|
|
|
|
@Column({
|
|
|
|
nullable: false,
|
2020-08-18 00:29:49 +02:00
|
|
|
default: '',
|
2020-04-10 04:04:13 +02:00
|
|
|
})
|
2020-07-25 02:02:37 +02:00
|
|
|
public nameCanonical!: string;
|
2020-04-10 04:04:13 +02:00
|
|
|
|
2021-01-24 19:11:45 +01:00
|
|
|
@OneToMany(() => SiteName, (siteName: SiteNameEntityInterface) => siteName.entity)
|
|
|
|
public names!: Promise<SiteNameEntityInterface[]>;
|
2020-04-10 04:04:13 +02:00
|
|
|
|
2021-01-24 19:11:45 +01:00
|
|
|
@OneToMany(() => Source, (source: SourceEntityInterface) => source.site)
|
|
|
|
public sources!: Promise<SourceEntityInterface[]>;
|
2019-06-23 02:30:24 +02:00
|
|
|
}
|