RenaiApp/src/main/entities/library/collection-name.ts

22 lines
568 B
TypeScript

import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Collection } from './collection';
@Entity()
export class CollectionName implements CollectionNameEntityInterface {
@PrimaryGeneratedColumn()
public readonly id!: number;
@ManyToOne(() => Collection, (collection: CollectionEntityInterface) => collection.names, {
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
})
public entity!: Promise<CollectionEntityInterface>;
@Column({
nullable: false,
default: '',
})
public name!: string;
}