Skip to content

Commit

Permalink
Merge tag 'v2.3.15' into develop
Browse files Browse the repository at this point in the history
v2.3.15
  • Loading branch information
ambroisemaupate committed Jun 26, 2024
2 parents 7b92b9e + 7fb21f7 commit 0320fb6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions lib/RoadizCoreBundle/migrations/Version20240318204224.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 0320fb6

Please sign in to comment.