Skip to content

Commit

Permalink
Merge tag v2.4.4 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Jan 10, 2025
1 parent 7ba6952 commit 1f69500
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 94 deletions.
2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
parameters:
roadiz_core.cms_version: '2.4.3'
roadiz_core.cms_version: '2.4.4'
roadiz_core.cms_version_prefix: 'main'
env(APP_NAMESPACE): "roadiz"
env(APP_VERSION): "0.1.0"
Expand Down
6 changes: 4 additions & 2 deletions migrations/Version20201203004857.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
$this->mysqlUp();
} elseif ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
} elseif ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->postgresUp();
}
}
Expand Down
5 changes: 3 additions & 2 deletions migrations/Version20201214232628.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

Expand All @@ -17,7 +18,7 @@ public function getDescription(): string
public function up(Schema $schema): void
{
$this->skipIf(
'mysql' !== $this->connection->getDatabasePlatform()->getName(),
!$this->connection->getDatabasePlatform() instanceof MySQLPlatform,
'Migration can only be executed safely on \'mysql\'.'
);
$this->skipIf($schema->hasTable('usergroups'), 'Table `usergroups` already exists.');
Expand All @@ -37,7 +38,7 @@ public function up(Schema $schema): void
public function down(Schema $schema): void
{
$this->skipIf(
'mysql' !== $this->connection->getDatabasePlatform()->getName(),
!$this->connection->getDatabasePlatform() instanceof MySQLPlatform,
'Migration can only be executed safely on \'mysql\'.'
);
$this->skipIf($schema->hasTable('groups'), 'Table `groups` already exists.');
Expand Down
9 changes: 5 additions & 4 deletions migrations/Version20210423164248.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

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

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

public function down(Schema $schema): void
{
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->addSql('DROP INDEX IF EXISTS answer_customform_submitted_at');
$this->addSql('DROP INDEX IF EXISTS cffattribute_answer_field');
$this->addSql('DROP INDEX IF EXISTS cfield_customform_positio');
Expand Down Expand Up @@ -95,7 +96,7 @@ public function down(Schema $schema): void
$this->addSql('CREATE INDEX IDX_7C7DED6DE0D4FDE14AD260649CAA2B25 ON nodes_sources (published_at, discr, translation_id)');
$this->addSql('CREATE INDEX IDX_7C7DED6D2B36786BE0D4FDE19CAA2B25 ON nodes_sources (title, published_at, translation_id)');

if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->addSql('ALTER INDEX IF EXISTS ns_title_published RENAME TO IDX_7C7DED6D2B36786BE0D4FDE1');
$this->addSql('ALTER INDEX IF EXISTS ns_node_discr_translation RENAME TO ns_node_translation_discr');
$this->addSql('ALTER INDEX IF EXISTS ns_discr_translation RENAME TO IDX_7C7DED6D4AD260649CAA2B25');
Expand Down
7 changes: 4 additions & 3 deletions migrations/Version20210506085247.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

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

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

public function down(Schema $schema): void
{
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->addSql('DROP INDEX node_status_parent');
$this->addSql('DROP INDEX node_nodetype_status_parent');
$this->addSql('DROP INDEX node_nodetype_status_parent_position');
Expand Down
10 changes: 6 additions & 4 deletions migrations/Version20210520092543.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

public function up(Schema $schema): void
{
if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
/*
* MYSQL
*/
$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');
$this->addSql('ALTER TABLE node_types ADD searchable TINYINT(1) DEFAULT \'1\' NOT NULL');
$this->addSql('CREATE INDEX nt_searchable ON node_types (searchable)');
} elseif ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
} elseif ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
/*
* POSTGRES
*/
Expand All @@ -42,11 +44,11 @@ public function up(Schema $schema): void

public function down(Schema $schema): void
{
if ('mysql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
$this->addSql('ALTER TABLE node_type_fields DROP serialization_exclusion_expression, DROP serialization_groups, DROP serialization_max_depth, DROP excluded_from_serialization');
$this->addSql('DROP INDEX nt_searchable ON node_types');
$this->addSql('ALTER TABLE node_types DROP searchable');
} elseif ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
} elseif ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
/*
* POSTGRES
*/
Expand Down
5 changes: 3 additions & 2 deletions migrations/Version20210527131435.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

public function up(Schema $schema): void
{
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE TEXT');
$this->addSql('ALTER TABLE redirections ALTER redirecturi DROP DEFAULT');
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE TEXT');
Expand All @@ -27,7 +28,7 @@ public function up(Schema $schema): void

public function down(Schema $schema): void
{
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE redirections ALTER redirecturi DROP DEFAULT');
$this->addSql('ALTER TABLE redirections ALTER redirecturi TYPE VARCHAR(255)');
Expand Down
3 changes: 2 additions & 1 deletion migrations/Version20210701151713.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

public function up(Schema $schema): void
{
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$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))');
$this->addSql('CREATE INDEX webhook_message_type ON webhooks (message_type)');
$this->addSql('CREATE INDEX webhook_created_at ON webhooks (created_at)');
Expand Down
5 changes: 3 additions & 2 deletions migrations/Version20210715120118.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

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

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

public function down(Schema $schema): void
{
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$this->addSql('ALTER TABLE webhooks DROP CONSTRAINT FK_998C4FDDC2A25172');
$this->addSql('DROP INDEX webhook_root_node');
} else {
Expand Down
1 change: 0 additions & 1 deletion src/Entity/NodeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class NodeType extends AbstractEntity implements NodeTypeInterface
Serializer\Type('string'),
Assert\NotNull(),
Assert\NotBlank(),
RoadizAssert\NonSqlReservedWord(),
RoadizAssert\SimpleLatinString(),
// Limit discriminator column to 30 characters for indexing optimization
Assert\Length(max: 30)
Expand Down
Loading

0 comments on commit 1f69500

Please sign in to comment.