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