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()
|
2020-07-25 02:02:37 +02:00
|
|
|
public id!: number;
|
2020-04-10 04:04:13 +02:00
|
|
|
|
2020-04-10 05:12:14 +02:00
|
|
|
@ManyToOne(() => AuthorRole, (authorRole: AuthorRole) => authorRole.names, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: 'CASCADE',
|
|
|
|
onUpdate: 'CASCADE',
|
|
|
|
})
|
2020-07-25 02:02:37 +02:00
|
|
|
public entity!: Promise<AuthorRole>;
|
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
|
|
|
}
|