set empty thridparty.firstname to a string

This commit is contained in:
Julien Fastré 2022-03-24 18:51:08 +01:00
parent 726b8f0e3c
commit d0c34c0206
2 changed files with 5 additions and 5 deletions

View File

@ -198,10 +198,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
private ?string $email = null; 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"}) * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/ */
private ?string $firstname = null; private string $firstname = '';
/** /**
* @var int * @var int
@ -460,7 +460,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
return $this->email; return $this->email;
} }
public function getFirstname(): ?string public function getFirstname(): string
{ {
return $this->firstname; return $this->firstname;
} }
@ -767,7 +767,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
return $this; return $this;
} }
public function setFirstname($firstname): self public function setFirstname(string $firstname): self
{ {
$this->firstname = $firstname; $this->firstname = $firstname;

View File

@ -33,6 +33,6 @@ final class Version20220322095659 extends AbstractMigration
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
// this up() migration is auto-generated, please modify it to your needs // 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 \'\'');
} }
} }