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