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