mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-10-20 22:22:09 -04:00
20 lines
320 B
TypeScript
20 lines
320 B
TypeScript
|
import { Column, Entity, ManyToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||
|
import { Note } from './note.entity';
|
||
|
|
||
|
@Entity()
|
||
|
export class Tag {
|
||
|
@PrimaryGeneratedColumn()
|
||
|
id: number;
|
||
|
|
||
|
@Column({
|
||
|
nullable: false,
|
||
|
})
|
||
|
name: string;
|
||
|
|
||
|
@ManyToMany(
|
||
|
_ => Note,
|
||
|
note => note.tags,
|
||
|
)
|
||
|
notes: Note[];
|
||
|
}
|