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