<?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 Version20260325133654 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 channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75D182060A');
$this->addSql('DROP INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts');
$this->addSql('ALTER TABLE channel_positioning_test_attempts DROP prospect_id');
$this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_uuid prospect_id VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE contacts MODIFY id INT NOT NULL');
$this->addSql('DROP INDEX `primary` ON contacts');
$this->addSql('ALTER TABLE contacts DROP id, CHANGE uuid uuid VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
$this->addSql('ALTER TABLE contacts ADD PRIMARY KEY (uuid)');
$this->addSql('DROP INDEX `primary` ON contacts');
$this->addSql('ALTER TABLE contacts CHANGE uuid id VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
$this->addSql('ALTER TABLE contacts ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_id prospect_id VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
$this->addSql('ALTER TABLE channel_positioning_test_attempts ADD CONSTRAINT FK_AEEA1A75D182060A FOREIGN KEY (prospect_id) REFERENCES contacts (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts (prospect_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75D182060A');
$this->addSql('DROP INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts');
$this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_id prospect_id VARCHAR(255) NOT NULL');
$this->addSql('DROP INDEX `PRIMARY` ON contacts');
$this->addSql('ALTER TABLE contacts CHANGE id uuid VARCHAR(36) DEFAULT \'uuid()\' NOT NULL');
$this->addSql('ALTER TABLE contacts ADD PRIMARY KEY (uuid)');
$this->addSql('ALTER TABLE contacts ADD id INT AUTO_INCREMENT NOT NULL, CHANGE uuid uuid VARCHAR(36) DEFAULT \'uuid()\', DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE channel_positioning_test_attempts CHANGE prospect_id prospect_uuid VARCHAR(36) DEFAULT NULL');
$this->addSql('ALTER TABLE channel_positioning_test_attempts ADD prospect_id INT NOT NULL');
$this->addSql('ALTER TABLE channel_positioning_test_attempts ADD CONSTRAINT FK_AEEA1A75D182060A FOREIGN KEY (prospect_id) REFERENCES contacts (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_AEEA1A75D182060A ON channel_positioning_test_attempts (prospect_id)');
}
}