2020-04-10 04:04:13 +02:00
|
|
|
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
2020-04-10 05:02:19 +02:00
|
|
|
import { Site } from './site';
|
2020-04-10 04:04:13 +02:00
|
|
|
|
|
|
|
@Entity()
|
2021-01-24 19:11:45 +01:00
|
|
|
export class SiteName implements SiteNameEntityInterface {
|
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
|
|
|
|
2021-01-24 19:11:45 +01:00
|
|
|
@ManyToOne(() => Site, (site: SiteEntityInterface) => site.names, {
|
2020-04-10 05:12:14 +02:00
|
|
|
nullable: false,
|
|
|
|
onDelete: 'CASCADE',
|
|
|
|
onUpdate: 'CASCADE',
|
|
|
|
})
|
2021-01-24 19:11:45 +01:00
|
|
|
public entity!: Promise<SiteEntityInterface>;
|
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 name!: string;
|
2020-04-10 04:04:13 +02:00
|
|
|
}
|