最后活跃于 1729145740

knox 修订了这个 Gist 1729145740. 跳至此修订

1 file changed, 17 insertions

TypeORM-readme-31.ts(file created)

@@ -0,0 +1,17 @@
1 + import {
2 + Entity,
3 + Column,
4 + PrimaryGeneratedColumn,
5 + OneToOne,
6 + JoinColumn,
7 + } from "typeorm"
8 + import { Photo } from "./Photo"
9 +
10 + @Entity()
11 + export class PhotoMetadata {
12 + /* ... other columns */
13 +
14 + @OneToOne(() => Photo, (photo) => photo.metadata)
15 + @JoinColumn()
16 + photo: Photo
17 + }
更新 更早