最后活跃于 1729146247

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

1 file changed, 11 insertions

TypeORM-readme-40.ts(file created)

@@ -0,0 +1,11 @@
1 + import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from "typeorm"
2 + import { PhotoMetadata } from "./PhotoMetadata"
3 + import { Author } from "./Author"
4 +
5 + @Entity()
6 + export class Photo {
7 + /* ... other columns */
8 +
9 + @ManyToOne(() => Author, (author) => author.photos)
10 + author: Author
11 + }
更新 更早