From 800942bc92c76aa44aab9c8bff2ac9d9d53e5beb Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 Apr 2024 17:09:44 +0200 Subject: [PATCH] Add missing columns to report tables --- .../ChillJobBundle/src/Entity/Frein.php | 4 +- .../ChillJobBundle/src/Entity/Immersion.php | 6 +-- .../src/Entity/ProjetProfessionnel.php | 6 +-- .../src/migrations/Version20240424140641.php | 39 +++++++++++++++++++ 4 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php diff --git a/src/Bundle/ChillJobBundle/src/Entity/Frein.php b/src/Bundle/ChillJobBundle/src/Entity/Frein.php index 722109069..4236e4aec 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Frein.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Frein.php @@ -79,11 +79,9 @@ class Frein implements HasPerson, \Stringable private ?string $notesEmploi = ''; /** - * @ORM\ManytoOne( - * targetEntity="Chill\PersonBundle\Entity\Person") - * * @Assert\NotNull() */ + #[ORM\ManyToOne(targetEntity: Person::class)] private Person $person; public function __construct() diff --git a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php index dcd2f029e..94137a34a 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php @@ -39,13 +39,9 @@ class Immersion implements \Stringable private ?int $id = null; /** - * @var Person - * - * @ORM\ManytoOne( - * targetEntity="Chill\PersonBundle\Entity\Person") - * * @Assert\NotNull() */ + #[ORM\ManyToOne(targetEntity: Person::class)] private $person; /** diff --git a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php index 363098f3a..e9ed41bb5 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php +++ b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php @@ -33,13 +33,9 @@ class ProjetProfessionnel implements \Stringable private ?int $id = null; /** - * @var Person - * - * @ORM\ManytoOne( - * targetEntity="Chill\PersonBundle\Entity\Person") - * * @Assert\NotNull() */ + #[ORM\ManyToOne(targetEntity: Person::class)] private $person; /** diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php new file mode 100644 index 000000000..5381199ff --- /dev/null +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php @@ -0,0 +1,39 @@ +addSql('ALTER TABLE chill_csconnectes.frein ADD person_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_csconnectes.frein ADD CONSTRAINT FK_172EAC0A217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_172EAC0A217BBB47 ON chill_csconnectes.frein (person_id)'); + $this->addSql('ALTER TABLE chill_csconnectes.immersion ADD person_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB4217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_FBB3CBB4217BBB47 ON chill_csconnectes.immersion (person_id)'); + $this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel ADD person_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel ADD CONSTRAINT FK_12E4FFBF217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_12E4FFBF217BBB47 ON chill_csconnectes.projet_professionnel (person_id)'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel DROP CONSTRAINT FK_12E4FFBF217BBB47'); + $this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel DROP person_id'); + $this->addSql('ALTER TABLE chill_csconnectes.immersion DROP CONSTRAINT FK_FBB3CBB4217BBB47'); + $this->addSql('ALTER TABLE chill_csconnectes.immersion DROP person_id'); + $this->addSql('ALTER TABLE chill_csconnectes.frein DROP CONSTRAINT FK_172EAC0A217BBB47'); + $this->addSql('ALTER TABLE chill_csconnectes.frein DROP person_id'); + } +}