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