Files
webapp-back/src/word/entities/topic.entity.ts
T
2024-12-30 18:16:25 +01:00

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[]>;
}