2020-04-10 04:04:13 +02:00
|
|
|
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
2020-04-10 05:02:19 +02:00
|
|
|
import { AuthorRole } from './author-role';
|
2020-04-10 04:04:13 +02:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class AuthorRoleName implements IIdentifiableEntity, INameEntity {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
public id: number;
|
|
|
|
|
2020-04-10 05:12:14 +02:00
|
|
|
@ManyToOne(() => AuthorRole, (authorRole: AuthorRole) => authorRole.names, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: 'CASCADE',
|
|
|
|
onUpdate: 'CASCADE',
|
|
|
|
})
|
2020-04-10 04:04:13 +02:00
|
|
|
public entity: Promise<AuthorRole>;
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
nullable: false,
|
|
|
|
})
|
|
|
|
public name: string;
|
|
|
|
}
|