knox revidoval tento gist . Přejít na revizi
1 file changed, 16 insertions
TypeORM-readme-34.ts(vytvořil soubor)
@@ -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 | + | } |
Novější
Starší