24 lines
446 B
TypeScript
24 lines
446 B
TypeScript
import { Work } from './work';
|
|
import { Entity, ManyToMany, PrimaryColumn } from 'typeorm';
|
|
|
|
/**
|
|
* This entity is non-user-maintained and describes a language.
|
|
*/
|
|
@Entity()
|
|
export class Language {
|
|
/**
|
|
* ISO 639-1 two-letter language code
|
|
*/
|
|
@PrimaryColumn()
|
|
public code: string;
|
|
|
|
/**
|
|
* the works using this language
|
|
*/
|
|
@ManyToMany(
|
|
() => Work,
|
|
(work: Work) => work.languages
|
|
)
|
|
public works: Promise<Work[]>;
|
|
}
|