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

corrigiendo relacion available-date y place

parent ffc43835
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm';
import { Place } from './place.entity';

@Entity()
export class AvailableDate {
  @PrimaryGeneratedColumn()
  idAvailableDate: number;
  @PrimaryColumn()
  idPlace: number;

  @JoinColumn({ name: 'idPlace' })
  @ManyToOne(() => Place, (place) => place.availableDates, { nullable: false })
  idPlace: Place;
  place: Place;

  @Column()
  startDate: Date;
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ export class Place {
  @OneToMany(() => PointOfInterest, (point) => point.idPoint)
  points: PointOfInterest[];

  @OneToMany(() => AvailableDate, (available) => available.idPlace)
  @OneToMany(() => AvailableDate, (available) => available.place)
  availableDates: AvailableDate[];

  @ManyToMany(() => Category)