import { Entity , PrimaryGeneratedColumn , Column , ManyToOne , JoinColumn } from 'typeorm' ; import { User } from './User.entity' ; @ Entity ( ) export class Pet { @ PrimaryGeneratedColumn ( 'uuid' ) id : string ; @ Column ( ) name : string ; @ Column ( ) age : number ; @ ManyToOne ( ( type ) => User , ( user ) => user . pets ) @ JoinColumn ( { name : 'user_id' } ) user : User ; }