Fix relation cascade issue on question

#26
docker
root 2018-06-06 15:52:56 +02:00
parent c19d23d9a2
commit a4038005e8
3 changed files with 10 additions and 7 deletions

View File

@ -14,9 +14,9 @@ services:
build: ./docker/php-fpm
ports:
- "9001:9000"
#volumes:
# - ./symfony:/var/www/symfony:cached
# - ./logs/symfony:/var/www/symfony/var/logs:cached
volumes:
- ./symfony:/var/www/symfony:cached
- ./logs/symfony:/var/www/symfony/var/logs:cached
links:
- db
nginx:
@ -48,6 +48,6 @@ services:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3000:3000'
- '3001:3000'
environment:
- NODE_ENV=development

View File

@ -3,6 +3,8 @@ FROM node:9.6.1
# set working directory
RUN mkdir /usr/src/app
RUN chmod -R 755 /var/www/am-i-late/logs
USER $USER
WORKDIR /usr/src/app
# add `/usr/src/app/node_modules/.bin` to $PATH
@ -10,6 +12,7 @@ ENV PATH /usr/src/app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY client/package.json /usr/src/app/package.json
#RUN chown -R $USER /usr/src/app
RUN npm install --silent
#RUN npm install react-scripts@1.1.1 -g --silent

View File

@ -39,7 +39,7 @@ class Question
private $date;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Response", mappedBy="question")
* @ORM\OneToMany(targetEntity="App\Entity\Response", mappedBy="question", orphanRemoval=true, cascade={"persist", "remove", "merge"})
* @ORM\JoinTable(name="response")
* @ApiSubresource()
*/
@ -66,7 +66,7 @@ class Question
return $this->id;
}
public function getText(): string
public function getText(): ?string
{
return $this->text;
}