From d0c34c02063dd1f35a3449d2185e6deb3d864243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 24 Mar 2022 18:51:08 +0100 Subject: [PATCH] set empty thridparty.firstname to a string --- src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php | 8 ++++---- .../migrations/Version20220322095659.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index fff378cdb..d7efce10c 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -198,10 +198,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface private ?string $email = null; /** - * @ORM\Column(name="firstname", type="string", length=255, nullable=true) + * @ORM\Column(name="firstname", type="text", options={"default":""}) * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) */ - private ?string $firstname = null; + private string $firstname = ''; /** * @var int @@ -460,7 +460,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this->email; } - public function getFirstname(): ?string + public function getFirstname(): string { return $this->firstname; } @@ -767,7 +767,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setFirstname($firstname): self + public function setFirstname(string $firstname): self { $this->firstname = $firstname; diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php index 454785037..140539d1e 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php @@ -33,6 +33,6 @@ final class Version20220322095659 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE chill_3party.third_party ADD firstname VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_3party.third_party ADD firstname TEXT DEFAULT \'\''); } }