allow null values on phonenumber in location and person

This commit is contained in:
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;
/**
* @ORM\Column(type="phone_number")
* @ORM\Column(type="phone_number", nullable=true)
* @Serializer\Groups({"read", "write", "docgen:read"})
* @PhonenumberConstraint(type="any")
*/
private ?PhoneNumber $phonenumber1 = null;
/**
* @ORM\Column(type="phone_number")
* @ORM\Column(type="phone_number", nullable=true)
* @Serializer\Groups({"read", "write", "docgen:read"})
* @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 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 phonenumber2 TYPE VARCHAR(35)');
$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('COMMENT ON COLUMN chill_main_location.phonenumber1 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 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 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.phonenumber2 IS NULL');
}