From 03e86245281d01c1ad9ca37cbb7fd45392814494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 1 Sep 2021 14:03:23 +0200 Subject: [PATCH] entity person: allow center to be not null --- .../ChillPersonBundle/Entity/Person.php | 1 - .../migrations/Version20210831140339.php | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 35db2ef83..5bfe3bd10 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -254,7 +254,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * @var Center * * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Center") - * @ORM\JoinColumn(nullable=false) */ private $center; diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php b/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php new file mode 100644 index 000000000..dd3a60d75 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE chill_person_person ALTER center_id DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_person ALTER center_id SET NOT NULL'); + } +}