diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 2e8cebfb6..43f053c77 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -250,14 +250,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface /** * [fr] Qualité. - * - * @var ThirdPartyProfession - * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession") - * ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true) + * @ORM\Column(name="profession", type="string", length=255, nullable=false) * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) * @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"}) */ - private ?ThirdPartyProfession $profession = null; + private string $profession = ''; /** * @ORM\Column(name="telephone", type="phone_number", nullable=true) @@ -491,9 +488,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface } /** - * @return ThirdPartyProfession + * @return string */ - public function getProfession(): ?ThirdPartyProfession + public function getProfession(): string { return $this->profession; } @@ -811,7 +808,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface /** * @return $this */ - public function setProfession(?ThirdPartyProfession $profession): ThirdParty + public function setProfession(string $profession): self { $this->profession = $profession; diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php new file mode 100644 index 000000000..b87e722b4 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE chill_3party.third_party ADD profession VARCHAR(255) DEFAULT \'\' NOT NULL'); + +// $this->addSql('ALTER TABLE chill_3party.third_party DROP profession_id'); + } + + public function down(Schema $schema): void + { +// $this->addSql('ALTER TABLE chill_3party.third_party ADD profession_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_3party.third_party DROP profession'); + } +}