<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Exception;
final class Version20231016113323 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__declination ADD options JSON NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__declination DROP options');
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
try {
$conn = $this->connection->prepare("UPDATE `products_bundle__declination` SET options = '[]'");
$conn->executeQuery();
} catch (Exception $e) {
}
}
}