Última atividade 1729146212

knox revisou este gist 1729146211. Ir para a revisão

1 file changed, 20 insertions

TypeORM-readme-39.ts(arquivo criado)

@@ -0,0 +1,20 @@
1 + import {
2 + Entity,
3 + Column,
4 + PrimaryGeneratedColumn,
5 + OneToMany,
6 + JoinColumn,
7 + } from "typeorm"
8 + import { Photo } from "./Photo"
9 +
10 + @Entity()
11 + export class Author {
12 + @PrimaryGeneratedColumn()
13 + id: number
14 +
15 + @Column()
16 + name: string
17 +
18 + @OneToMany(() => Photo, (photo) => photo.author) // note: we will create author property in the Photo class below
19 + photos: Photo[]
20 + }
Próximo Anterior