knox gist felülvizsgálása . Revízióhoz ugrás
1 file changed, 18 insertions
TypeORM-readme-33.ts(fájl létrehozva)
@@ -0,0 +1,18 @@ | |||
1 | + | import { | |
2 | + | Entity, | |
3 | + | Column, | |
4 | + | PrimaryGeneratedColumn, | |
5 | + | OneToOne, | |
6 | + | JoinColumn, | |
7 | + | Relation, | |
8 | + | } from "typeorm" | |
9 | + | import { Photo } from "./Photo" | |
10 | + | ||
11 | + | @Entity() | |
12 | + | export class PhotoMetadata { | |
13 | + | /* ... other columns */ | |
14 | + | ||
15 | + | @OneToOne(() => Photo, (photo) => photo.metadata) | |
16 | + | @JoinColumn() | |
17 | + | photo: Relation<Photo> | |
18 | + | } |
Újabb
Régebbi