22 lines
505 B
TypeScript
22 lines
505 B
TypeScript
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { Tag } from './tag';
|
|
|
|
@Entity()
|
|
export class TagName implements TagNameEntityInterface {
|
|
@PrimaryGeneratedColumn()
|
|
public readonly id!: number;
|
|
|
|
@ManyToOne(() => Tag, (tag: TagEntityInterface) => tag.names, {
|
|
nullable: false,
|
|
onDelete: 'CASCADE',
|
|
onUpdate: 'CASCADE',
|
|
})
|
|
public entity!: Promise<TagEntityInterface>;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
default: '',
|
|
})
|
|
public name!: string;
|
|
}
|