25 lines
488 B
TypeScript
25 lines
488 B
TypeScript
|
import { Site } from './site';
|
||
|
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||
|
|
||
|
@Entity()
|
||
|
export class SiteName implements IIdentifiableEntity, INameEntity {
|
||
|
@PrimaryGeneratedColumn()
|
||
|
public id: number;
|
||
|
|
||
|
@ManyToOne(
|
||
|
() => Site,
|
||
|
(site: Site) => site.names,
|
||
|
{
|
||
|
nullable: false,
|
||
|
onDelete: 'CASCADE',
|
||
|
onUpdate: 'CASCADE',
|
||
|
}
|
||
|
)
|
||
|
public entity: Promise<Site>;
|
||
|
|
||
|
@Column({
|
||
|
nullable: false,
|
||
|
})
|
||
|
public name: string;
|
||
|
}
|