Loading backend/src/place/entities/place.entity.ts +7 −3 Original line number Diff line number Diff line import { Activity } from 'src/activity/entities/activity.entity'; import { Available } from 'src/activity/enum/available.enum'; import { Town } from 'src/town/entities/town.entity'; import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { AvailableDate } from './available-date.entity'; @Entity() Loading @@ -9,8 +9,9 @@ export class Place { @PrimaryGeneratedColumn() idPlace: number; @ManyToOne(() => Town, (town) => town.places, { nullable: false }) towns: Town; @JoinColumn({ name: 'idTown' }) @ManyToOne(() => Town, (town) => town.townId, { nullable: false }) idTown: Town; @OneToMany(() => Activity, (activity) => activity.idActivity) activities: Activity[]; Loading @@ -24,6 +25,9 @@ export class Place { @Column() name: string; @Column() imageName: string; @Column({ nullable: false }) coords: string; Loading Loading
backend/src/place/entities/place.entity.ts +7 −3 Original line number Diff line number Diff line import { Activity } from 'src/activity/entities/activity.entity'; import { Available } from 'src/activity/enum/available.enum'; import { Town } from 'src/town/entities/town.entity'; import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { AvailableDate } from './available-date.entity'; @Entity() Loading @@ -9,8 +9,9 @@ export class Place { @PrimaryGeneratedColumn() idPlace: number; @ManyToOne(() => Town, (town) => town.places, { nullable: false }) towns: Town; @JoinColumn({ name: 'idTown' }) @ManyToOne(() => Town, (town) => town.townId, { nullable: false }) idTown: Town; @OneToMany(() => Activity, (activity) => activity.idActivity) activities: Activity[]; Loading @@ -24,6 +25,9 @@ export class Place { @Column() name: string; @Column() imageName: string; @Column({ nullable: false }) coords: string; Loading