knox ha revisionato questo gist . Vai alla revisione
1 file changed, 16 insertions
TypeORM-readme-34.ts(file creato)
@@ -0,0 +1,16 @@ | |||
1 | + | import { | |
2 | + | Entity, | |
3 | + | Column, | |
4 | + | PrimaryGeneratedColumn, | |
5 | + | OneToOne, | |
6 | + | Relation, | |
7 | + | } from "typeorm" | |
8 | + | import { PhotoMetadata } from "./PhotoMetadata" | |
9 | + | ||
10 | + | @Entity() | |
11 | + | export class Photo { | |
12 | + | /* ... other columns */ | |
13 | + | ||
14 | + | @OneToOne(() => PhotoMetadata, (photoMetadata) => photoMetadata.photo) | |
15 | + | metadata: Relation<PhotoMetadata> | |
16 | + | } |
Più nuovi
Più vecchi