<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Exception;
use Symfony\Component\Uid\UuidV6;
final class Version20240205085541 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
try {
$configurations = $this->connection->executeQuery('SELECT id FROM configuration WHERE name = "sales_bundle__price_calculation_with_eco_part"')->fetchAllAssociative();
foreach ($configurations as $config) {
$uuid = UuidV6::fromBinary($config['id'])->toRfc4122();
$this->connection->executeStatement("UPDATE configuration SET name = 'products_bundle__price_calculation_with_eco_part' WHERE id = UNHEX(CONCAT('', REPLACE('" . $uuid . "', '-', '')))");
}
} catch (Exception $e) {
}
}
}