Skip to content

Commit caefc8a

Browse files
author
roadiz-ci
committed
Merge branch hotfix/v2.4.4
1 parent e88ce2a commit caefc8a

11 files changed

+31
-94
lines changed

config/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
parameters:
3-
roadiz_core.cms_version: '2.4.3'
3+
roadiz_core.cms_version: '2.4.4'
44
roadiz_core.cms_version_prefix: 'main'
55
env(APP_NAMESPACE): "roadiz"
66
env(APP_VERSION): "0.1.0"

migrations/Version20201203004857.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\MySQLPlatform;
8+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
79
use Doctrine\DBAL\Schema\Schema;
810
use Doctrine\Migrations\AbstractMigration;
911

@@ -21,9 +23,9 @@ public function up(Schema $schema): void
2123
{
2224
$this->skipIf($schema->hasTable('nodes'), 'Database has been initialized before Doctrine Migration tool.');
2325

24-
if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
26+
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
2527
$this->mysqlUp();
26-
} elseif ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
28+
} elseif ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
2729
$this->postgresUp();
2830
}
2931
}

migrations/Version20201214232628.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\MySQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -17,7 +18,7 @@ public function getDescription(): string
1718
public function up(Schema $schema): void
1819
{
1920
$this->skipIf(
20-
'mysql' !== $this->connection->getDatabasePlatform()->getName(),
21+
!$this->connection->getDatabasePlatform() instanceof MySQLPlatform,
2122
'Migration can only be executed safely on \'mysql\'.'
2223
);
2324
$this->skipIf($schema->hasTable('usergroups'), 'Table `usergroups` already exists.');
@@ -37,7 +38,7 @@ public function up(Schema $schema): void
3738
public function down(Schema $schema): void
3839
{
3940
$this->skipIf(
40-
'mysql' !== $this->connection->getDatabasePlatform()->getName(),
41+
!$this->connection->getDatabasePlatform() instanceof MySQLPlatform,
4142
'Migration can only be executed safely on \'mysql\'.'
4243
);
4344
$this->skipIf($schema->hasTable('groups'), 'Table `groups` already exists.');

migrations/Version20210423164248.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -23,7 +24,7 @@ public function up(Schema $schema): void
2324
$this->addSql('CREATE INDEX customform_node_position ON nodes_custom_forms (node_id, position)');
2425
$this->addSql('CREATE INDEX customform_node_field_position ON nodes_custom_forms (node_id, node_type_field_id, position)');
2526

26-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
27+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
2728
$this->addSql('DROP INDEX IF EXISTS IDX_7C7DED6DE0D4FDE19CAA2B25');
2829
$this->addSql('DROP INDEX IF EXISTS IDX_7C7DED6DE0D4FDE14AD260649CAA2B25');
2930
$this->addSql('DROP INDEX IF EXISTS IDX_7C7DED6D2B36786BE0D4FDE19CAA2B25');
@@ -38,7 +39,7 @@ public function up(Schema $schema): void
3839
$this->addSql('CREATE INDEX ns_discr_translation_published ON nodes_sources (discr, translation_id, published_at)');
3940
$this->addSql('CREATE INDEX ns_title_translation_published ON nodes_sources (title, translation_id, published_at)');
4041

41-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
42+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
4243
$this->addSql('ALTER INDEX IF EXISTS ns_node_translation_discr RENAME TO ns_node_discr_translation');
4344
$this->addSql('ALTER INDEX IF EXISTS idx_7c7ded6d460d9fd79caa2b25e0d4fde1 RENAME TO ns_node_translation_published');
4445
$this->addSql('ALTER INDEX IF EXISTS idx_7c7ded6d4ad260649caa2b25 RENAME TO ns_discr_translation');
@@ -67,7 +68,7 @@ public function up(Schema $schema): void
6768

6869
public function down(Schema $schema): void
6970
{
70-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
71+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
7172
$this->addSql('DROP INDEX IF EXISTS answer_customform_submitted_at');
7273
$this->addSql('DROP INDEX IF EXISTS cffattribute_answer_field');
7374
$this->addSql('DROP INDEX IF EXISTS cfield_customform_positio');
@@ -95,7 +96,7 @@ public function down(Schema $schema): void
9596
$this->addSql('CREATE INDEX IDX_7C7DED6DE0D4FDE14AD260649CAA2B25 ON nodes_sources (published_at, discr, translation_id)');
9697
$this->addSql('CREATE INDEX IDX_7C7DED6D2B36786BE0D4FDE19CAA2B25 ON nodes_sources (title, published_at, translation_id)');
9798

98-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
99+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
99100
$this->addSql('ALTER INDEX IF EXISTS ns_title_published RENAME TO IDX_7C7DED6D2B36786BE0D4FDE1');
100101
$this->addSql('ALTER INDEX IF EXISTS ns_node_discr_translation RENAME TO ns_node_translation_discr');
101102
$this->addSql('ALTER INDEX IF EXISTS ns_discr_translation RENAME TO IDX_7C7DED6D4AD260649CAA2B25');

migrations/Version20210506085247.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -25,7 +26,7 @@ public function up(Schema $schema): void
2526
$this->addSql('CREATE INDEX node_visible_parent_position ON nodes (visible, parent_node_id, position)');
2627
$this->addSql('CREATE INDEX node_status_visible_parent_position ON nodes (status, visible, parent_node_id, position)');
2728

28-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
29+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
2930
$this->addSql('ALTER INDEX IF EXISTS idx_1d3d05fc7ab0e8597b00651c3445eb91 RENAME TO node_visible_status_parent');
3031
$this->addSql('ALTER INDEX IF EXISTS idx_1d3d05fc7ab0e8593445eb91 RENAME TO node_visible_parent');
3132
} else {
@@ -36,7 +37,7 @@ public function up(Schema $schema): void
3637
$this->addSql('CREATE INDEX tag_visible_position ON tags (visible, position)');
3738
$this->addSql('CREATE INDEX tag_parent_visible_position ON tags (parent_tag_id, visible, position)');
3839

39-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
40+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
4041
$this->addSql('ALTER INDEX IF EXISTS idx_6fbc9426f5c1a0d77ab0e859 RENAME TO tag_parent_visible');
4142
} else {
4243
$this->addSql('ALTER TABLE tags RENAME INDEX idx_6fbc9426f5c1a0d77ab0e859 TO tag_parent_visible');
@@ -45,7 +46,7 @@ public function up(Schema $schema): void
4546

4647
public function down(Schema $schema): void
4748
{
48-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
49+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
4950
$this->addSql('DROP INDEX node_status_parent');
5051
$this->addSql('DROP INDEX node_nodetype_status_parent');
5152
$this->addSql('DROP INDEX node_nodetype_status_parent_position');

migrations/Version20210520092543.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\MySQLPlatform;
8+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
79
use Doctrine\DBAL\Schema\Schema;
810
use Doctrine\Migrations\AbstractMigration;
911

@@ -19,14 +21,14 @@ public function getDescription(): string
1921

2022
public function up(Schema $schema): void
2123
{
22-
if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
24+
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
2325
/*
2426
* MYSQL
2527
*/
2628
$this->addSql('ALTER TABLE node_type_fields ADD serialization_exclusion_expression LONGTEXT DEFAULT NULL, ADD serialization_groups JSON DEFAULT NULL, ADD serialization_max_depth INT DEFAULT NULL, ADD excluded_from_serialization TINYINT(1) DEFAULT \'0\' NOT NULL');
2729
$this->addSql('ALTER TABLE node_types ADD searchable TINYINT(1) DEFAULT \'1\' NOT NULL');
2830
$this->addSql('CREATE INDEX nt_searchable ON node_types (searchable)');
29-
} elseif ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
31+
} elseif ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
3032
/*
3133
* POSTGRES
3234
*/
@@ -42,11 +44,11 @@ public function up(Schema $schema): void
4244

4345
public function down(Schema $schema): void
4446
{
45-
if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
47+
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
4648
$this->addSql('ALTER TABLE node_type_fields DROP serialization_exclusion_expression, DROP serialization_groups, DROP serialization_max_depth, DROP excluded_from_serialization');
4749
$this->addSql('DROP INDEX nt_searchable ON node_types');
4850
$this->addSql('ALTER TABLE node_types DROP searchable');
49-
} elseif ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
51+
} elseif ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
5052
/*
5153
* POSTGRES
5254
*/

migrations/Version20210527131435.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -16,7 +17,7 @@ public function getDescription(): string
1617

1718
public function up(Schema $schema): void
1819
{
19-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
20+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
2021
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE TEXT');
2122
$this->addSql('ALTER TABLE redirections ALTER redirecturi DROP DEFAULT');
2223
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE TEXT');
@@ -27,7 +28,7 @@ public function up(Schema $schema): void
2728

2829
public function down(Schema $schema): void
2930
{
30-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
31+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
3132
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE VARCHAR(255)');
3233
$this->addSql('ALTER TABLE redirections ALTER redirecturi DROP DEFAULT');
3334
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE VARCHAR(255)');

migrations/Version20210701151713.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -16,7 +17,7 @@ public function getDescription(): string
1617

1718
public function up(Schema $schema): void
1819
{
19-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
20+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
2021
$this->addSql('CREATE TABLE webhooks (id VARCHAR(36) NOT NULL, message_type VARCHAR(255) DEFAULT NULL, uri TEXT DEFAULT NULL, payload JSON DEFAULT NULL, throttleSeconds INT NOT NULL, last_triggered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, automatic BOOLEAN DEFAULT \'false\' NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
2122
$this->addSql('CREATE INDEX webhook_message_type ON webhooks (message_type)');
2223
$this->addSql('CREATE INDEX webhook_created_at ON webhooks (created_at)');

migrations/Version20210715120118.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace RZ\Roadiz\Migrations;
66

7+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
78
use Doctrine\DBAL\Schema\Schema;
89
use Doctrine\Migrations\AbstractMigration;
910

@@ -19,7 +20,7 @@ public function getDescription(): string
1920

2021
public function up(Schema $schema): void
2122
{
22-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
23+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
2324
$this->addSql('ALTER TABLE webhooks ADD root_node INT DEFAULT NULL');
2425
$this->addSql('ALTER TABLE webhooks ADD CONSTRAINT FK_998C4FDDC2A25172 FOREIGN KEY (root_node) REFERENCES nodes (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
2526
} else {
@@ -31,7 +32,7 @@ public function up(Schema $schema): void
3132

3233
public function down(Schema $schema): void
3334
{
34-
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
35+
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
3536
$this->addSql('ALTER TABLE webhooks DROP CONSTRAINT FK_998C4FDDC2A25172');
3637
$this->addSql('DROP INDEX webhook_root_node');
3738
} else {

src/Entity/NodeType.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class NodeType extends AbstractEntity implements NodeTypeInterface
5353
Serializer\Type('string'),
5454
Assert\NotNull(),
5555
Assert\NotBlank(),
56-
RoadizAssert\NonSqlReservedWord(),
5756
RoadizAssert\SimpleLatinString(),
5857
// Limit discriminator column to 30 characters for indexing optimization
5958
Assert\Length(max: 30)

0 commit comments

Comments
 (0)