19 lines
437 B
TypeScript
19 lines
437 B
TypeScript
import { Entity, OneToMany } from 'typeorm';
|
|
import { BaseEntity } from '../base-entity';
|
|
import { MultiNamed } from './base/multi-named';
|
|
import { Source } from './source';
|
|
|
|
@Entity()
|
|
export class Site extends MultiNamed(BaseEntity) {
|
|
@OneToMany(
|
|
() => Source,
|
|
(source: Source) => source.site,
|
|
{
|
|
nullable: false,
|
|
onDelete: 'CASCADE',
|
|
onUpdate: 'CASCADE',
|
|
}
|
|
)
|
|
public sources: Promise<Source[]>;
|
|
}
|