<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241119151020 extends AbstractMigration
{
public function getDescription(): string
{
return 'add platform to waitlist table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE waitlist ADD platform VARCHAR(255) DEFAULT NULL');
$this->addSql('DROP INDEX email ON waitlist');
$this->addSql('CREATE UNIQUE INDEX email_platform ON waitlist (email, platform)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX email_platform ON waitlist');
$this->addSql('ALTER TABLE waitlist DROP platform');
$this->addSql('CREATE UNIQUE INDEX email ON waitlist (email)');
}
}