From 6fda4a9b55361d9d49e847c79cc1876f5f3cce0a Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Wed, 26 Jun 2024 17:54:57 +0200 Subject: [PATCH 1/2] fix: Still execute migration Version20240318204224 when there are no node_type_fields: i.e at Roadiz first install --- .../migrations/Version20240318204224.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/RoadizCoreBundle/migrations/Version20240318204224.php b/lib/RoadizCoreBundle/migrations/Version20240318204224.php index 0897dc0b..1ac4f2f4 100644 --- a/lib/RoadizCoreBundle/migrations/Version20240318204224.php +++ b/lib/RoadizCoreBundle/migrations/Version20240318204224.php @@ -19,11 +19,16 @@ public function getDescription(): string public function up(Schema $schema): void { - $result = $this->connection->executeQuery('SELECT max(length(name)) FROM `node_type_fields`'); - $maxLength = $result->fetchOne(); + $result = $this->connection->executeQuery('SELECT count(id) FROM `node_type_fields`'); + $count = $result->fetchOne(); - $this->skipIf(!is_numeric($maxLength), 'Cannot find node_type_fields name maximum length.'); - $this->skipIf($maxLength >= 50, 'You have at least on node_type_field name that exceed 50 characters long.'); + if ($count > 0) { + $result = $this->connection->executeQuery('SELECT max(length(name)) FROM `node_type_fields`'); + $maxLength = $result->fetchOne(); + + $this->skipIf(!is_numeric($maxLength), 'Cannot find node_type_fields name maximum length.'); + $this->skipIf($maxLength >= 50, 'You have at least on node_type_field name that exceed 50 characters long.'); + } // this up() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE node_type_fields CHANGE name name VARCHAR(50) NOT NULL'); From a3ff4c2f759bedd8543b4c31ddc962c82bc805b5 Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Wed, 26 Jun 2024 17:58:02 +0200 Subject: [PATCH 2/2] chore: Bumped --- CHANGELOG.md | 6 ++++++ lib/RoadizCoreBundle/config/services.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 163eb723..a1bc49d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to Roadiz will be documented in this file. +## [2.3.15](https://github.com/roadiz/core-bundle-dev-app/compare/v2.3.14...v2.3.15) - 2024-06-26 + +### Bug Fixes + +- Still execute migration Version20240318204224 when there are no node_type_fields: i.e at Roadiz first install - ([6fda4a9](https://github.com/roadiz/core-bundle-dev-app/commit/6fda4a9b55361d9d49e847c79cc1876f5f3cce0a)) + ## [2.3.14](https://github.com/roadiz/core-bundle-dev-app/compare/v2.3.13...v2.3.14) - 2024-06-21 ### Bug Fixes diff --git a/lib/RoadizCoreBundle/config/services.yaml b/lib/RoadizCoreBundle/config/services.yaml index e4120845..a80bccca 100644 --- a/lib/RoadizCoreBundle/config/services.yaml +++ b/lib/RoadizCoreBundle/config/services.yaml @@ -1,6 +1,6 @@ --- parameters: - roadiz_core.cms_version: '2.3.14' + roadiz_core.cms_version: '2.3.15' roadiz_core.cms_version_prefix: 'main' env(APP_NAMESPACE): "roadiz" env(APP_VERSION): "0.1.0"