<?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 Version20260619140108 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('DROP INDEX `primary` ON channel_contacts');
$this->addSql('ALTER TABLE channel_contacts ADD id VARCHAR(36) DEFAULT NULL, ADD archived_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
$this->addSql('UPDATE channel_contacts SET id = UUID() WHERE id IS NULL');
$this->addSql('ALTER TABLE channel_contacts CHANGE id id VARCHAR(36) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_44F066DA72F5A1AAE7A1254A ON channel_contacts (channel_id, contact_id)');
$this->addSql('ALTER TABLE channel_contacts ADD PRIMARY KEY (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_44F066DA72F5A1AAE7A1254A ON channel_contacts');
$this->addSql('DROP INDEX `PRIMARY` ON channel_contacts');
$this->addSql('ALTER TABLE channel_contacts DROP id, DROP archived_at');
$this->addSql('ALTER TABLE channel_contacts ADD PRIMARY KEY (contact_id, channel_id)');
}
}