RenaiApp/src/main/entities/library/author-role-name.ts

21 lines
513 B
TypeScript
Raw Normal View History

import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { AuthorRole } from './author-role';
@Entity()
export class AuthorRoleName implements IIdentifiableEntity, INameEntity {
@PrimaryGeneratedColumn()
public id: number;
@ManyToOne(() => AuthorRole, (authorRole: AuthorRole) => authorRole.names, {
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
})
public entity: Promise<AuthorRole>;
@Column({
nullable: false,
})
public name: string;
}