Template
24 lines
402 B
TypeScript
24 lines
402 B
TypeScript
import { User } from 'src/users/entities/user.entity';
|
|
import {
|
|
Column,
|
|
Entity,
|
|
JoinTable,
|
|
ManyToMany,
|
|
ManyToOne,
|
|
OneToMany,
|
|
PrimaryGeneratedColumn,
|
|
Unique,
|
|
} from 'typeorm';
|
|
import { Word } from './word.entity';
|
|
|
|
@Entity()
|
|
export class Topic {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
@ManyToMany((type) => Word, (word) => word.topics)
|
|
words: Promise<Word[]>;
|
|
}
|