allow null values on phonenumber in location and person

This commit is contained in:
Julien Fastré 2022-03-02 15:53:39 +01:00
parent 6a3c8017f0
commit 09de7cbf7d
3 changed files with 4 additions and 8 deletions

View File

@ -91,14 +91,14 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
private ?string $name = null; private ?string $name = null;
/** /**
* @ORM\Column(type="phone_number") * @ORM\Column(type="phone_number", nullable=true)
* @Serializer\Groups({"read", "write", "docgen:read"}) * @Serializer\Groups({"read", "write", "docgen:read"})
* @PhonenumberConstraint(type="any") * @PhonenumberConstraint(type="any")
*/ */
private ?PhoneNumber $phonenumber1 = null; private ?PhoneNumber $phonenumber1 = null;
/** /**
* @ORM\Column(type="phone_number") * @ORM\Column(type="phone_number", nullable=true)
* @Serializer\Groups({"read", "write", "docgen:read"}) * @Serializer\Groups({"read", "write", "docgen:read"})
* @PhonenumberConstraint(type="any") * @PhonenumberConstraint(type="any")
*/ */

View File

@ -30,11 +30,9 @@ final class Version20220302132728 extends AbstractMigration implements Container
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(35)'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(35)');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 DROP DEFAULT'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 DROP DEFAULT');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 SET NOT NULL');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(35)'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(35)');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 TYPE VARCHAR(35)'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 TYPE VARCHAR(35)');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 DROP DEFAULT'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 DROP DEFAULT');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 SET NOT NULL');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 TYPE VARCHAR(35)'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 TYPE VARCHAR(35)');
$this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber1 IS \'(DC2Type:phone_number)\''); $this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber1 IS \'(DC2Type:phone_number)\'');
$this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber2 IS \'(DC2Type:phone_number)\''); $this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber2 IS \'(DC2Type:phone_number)\'');
@ -51,10 +49,8 @@ final class Version20220302132728 extends AbstractMigration implements Container
{ {
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(64)'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(64)');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 DROP DEFAULT'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 DROP DEFAULT');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 DROP NOT NULL');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 TYPE VARCHAR(64)'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 TYPE VARCHAR(64)');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 DROP DEFAULT'); $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 DROP DEFAULT');
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber2 DROP NOT NULL');
$this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber1 IS NULL'); $this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber1 IS NULL');
$this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber2 IS NULL'); $this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber2 IS NULL');
} }

View File

@ -373,7 +373,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* The person's mobile phone number. * The person's mobile phone number.
* *
* @PhonenumberConstraint(type="mobile") * @PhonenumberConstraint(type="mobile")
* @ORM\Column(type="phone_number") * @ORM\Column(type="phone_number", nullable=true)
*/ */
private ?PhoneNumber $mobilenumber = null; private ?PhoneNumber $mobilenumber = null;
@ -425,7 +425,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/** /**
* The person's phonenumber. * The person's phonenumber.
* *
* @ORM\Column(type="phone_number") * @ORM\Column(type="phone_number", nullable=true)
* @PhonenumberConstraint( * @PhonenumberConstraint(
* type="landline", * type="landline",
* ) * )