Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.1' into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-moser committed Dec 2, 2024
2 parents 6307fad + 096045f commit fa8570d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
45 changes: 45 additions & 0 deletions src/Migrations/Version20240823111615.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace OutputDataConfigToolkitBundle\Migrations;

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

final class Version20240823111615 extends AbstractMigration
{
public function getDescription(): string
{
return 'Migrate bundle_outputdataconfigtoolkit_outputdefinition table columns';
}

public function up(Schema $schema): void
{
$query = "ALTER TABLE `bundle_outputdataconfigtoolkit_outputdefinition` CHANGE COLUMN `configuration` `configuration` LONGTEXT
CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin' NULL DEFAULT NULL;";

$this->addSql($query);
}

public function down(Schema $schema): void
{
$query = "ALTER TABLE `bundle_outputdataconfigtoolkit_outputdefinition` CHANGE COLUMN `configuration` `configuration` LONGTEXT
CHARACTER SET 'latin1' NULL DEFAULT NULL;";

$this->addSql($query);
}
}
6 changes: 3 additions & 3 deletions src/Tools/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function install(): void
`id` int(11) NOT NULL AUTO_INCREMENT,
`objectId` int(11) NOT NULL,
`classId` varchar(50) NOT NULL,
`channel` varchar(255) COLLATE utf8_bin NOT NULL,
`configuration` longtext CHARACTER SET latin1,
`channel` varchar(255) NOT NULL,
`configuration` longtext,
PRIMARY KEY (`id`),
UNIQUE KEY `Unique` (`objectId`,`classId`,`channel`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Expand Down Expand Up @@ -78,7 +78,7 @@ public function uninstall(): void
$db->executeQuery('DROP TABLE IF EXISTS `' . Dao::TABLE_NAME . '`;');

$db->executeQuery("DELETE FROM users_permission_definitions WHERE `key` = 'bundle_outputDataConfigToolkit'");
if (self::isInstalled()) {
if ($this->isInstalled()) {
throw new InstallationException('Could not be uninstalled.');
}
}
Expand Down

0 comments on commit fa8570d

Please sign in to comment.