RenaiApp/src/main/entities/library/language.ts

20 lines
404 B
TypeScript
Raw Normal View History

import { Column, Entity, ManyToMany } from 'typeorm';
import { BaseEntity } from '../base-entity';
import { Copy } from './copy';
@Entity()
export class Language extends BaseEntity {
@Column({
nullable: false,
unique: true,
})
public code: string;
@ManyToMany(() => Copy, {
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
})
public copies: Promise<Copy[]>;
}