From af36eccfafcbed686f16770d409193e2ecd80df9 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 14 May 2025 13:56:36 +0200 Subject: [PATCH] Allow more characters for maritalstatus id --- .../Entity/MaritalStatus.php | 2 +- .../migrations/Version20250514115009.php | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20250514115009.php diff --git a/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php b/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php index b64416113..5f88906bd 100644 --- a/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php +++ b/src/Bundle/ChillPersonBundle/Entity/MaritalStatus.php @@ -22,7 +22,7 @@ use Doctrine\ORM\Mapping as ORM; class MaritalStatus { #[ORM\Id] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 7)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 15)] private ?string $id; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20250514115009.php b/src/Bundle/ChillPersonBundle/migrations/Version20250514115009.php new file mode 100644 index 000000000..364456281 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20250514115009.php @@ -0,0 +1,36 @@ +addSql(<<<'SQL' + ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(15) + SQL); + $this->addSql(<<<'SQL' + ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(15) + SQL); + } + + public function down(Schema $schema): void + { + $this->addSql(<<<'SQL' + ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(7) + SQL); + $this->addSql(<<<'SQL' + ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7) + SQL); + } +}