<?php
declare(strict_types=1);
namespace TicketsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241216085515 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE tickets_bundle__ticket ADD options JSON NOT NULL');
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
$conn = $this->connection;
$conn->executeStatement("UPDATE tickets_bundle__ticket SET options = '[]'");
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE tickets_bundle__ticket DROP options');
}
}