Commit d2314da2 authored by Diego Iván's avatar Diego Iván
Browse files

corrigiendo error en la entidad Place

parent 32b2d96f
Loading
Loading
Loading
Loading
+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()
@@ -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[];
@@ -24,6 +25,9 @@ export class Place {
  @Column()
  name: string;

  @Column()
  imageName: string;

  @Column({ nullable: false })
  coords: string;