<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260325145844 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contacts DROP INDEX IDX_33401573E7927C74, ADD UNIQUE INDEX UNIQ_33401573E7927C74 (email)');
$this->addSql('ALTER TABLE contacts DROP FOREIGN KEY FK_44F066DA72F5A1AA_TMP');
$this->addSql('DROP INDEX UNIQ_3340157372F5A1AAE7927C74 ON contacts');
$this->addSql('DROP INDEX IDX_3340157372F5A1AA ON contacts');
$this->addSql('ALTER TABLE contacts DROP channel_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE contacts DROP INDEX UNIQ_33401573E7927C74, ADD INDEX IDX_33401573E7927C74 (email)');
$this->addSql('ALTER TABLE contacts ADD channel_id VARCHAR(36) NOT NULL');
$this->addSql('ALTER TABLE contacts ADD CONSTRAINT FK_44F066DA72F5A1AA_TMP FOREIGN KEY (channel_id) REFERENCES channel_channels (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_3340157372F5A1AAE7927C74 ON contacts (channel_id, email)');
$this->addSql('CREATE INDEX IDX_3340157372F5A1AA ON contacts (channel_id)');
}
}