knox revidoval tento gist . Přejít na revizi
1 file changed, 20 insertions
TypeORM-readme-43.sh(vytvořil soubor)
@@ -0,0 +1,20 @@ | |||
1 | + | import { | |
2 | + | Entity, | |
3 | + | PrimaryGeneratedColumn, | |
4 | + | Column, | |
5 | + | ManyToMany, | |
6 | + | JoinTable, | |
7 | + | } from "typeorm" | |
8 | + | ||
9 | + | @Entity() | |
10 | + | export class Album { | |
11 | + | @PrimaryGeneratedColumn() | |
12 | + | id: number | |
13 | + | ||
14 | + | @Column() | |
15 | + | name: string | |
16 | + | ||
17 | + | @ManyToMany(() => Photo, (photo) => photo.albums) | |
18 | + | @JoinTable() | |
19 | + | photos: Photo[] | |
20 | + | } |
Novější
Starší