<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260804173000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Stable 16-character ultrasonic XR code for programs';
}
public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration is MySQL only.');
$this->addSql('ALTER TABLE program ADD xr_code VARCHAR(16) DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_PROGRAM_XR_CODE ON program (xr_code)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX UNIQ_PROGRAM_XR_CODE ON program');
$this->addSql('ALTER TABLE program DROP xr_code');
}
}