<?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 Version20220426082428 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('CREATE TABLE form_lead (id INT AUTO_INCREMENT NOT NULL, campaign_id INT NOT NULL, uuid BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_BCB065DCD17F50A6 (uuid), INDEX IDX_BCB065DCF639F774 (campaign_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE form_lead_data (id INT AUTO_INCREMENT NOT NULL, form_lead_id INT NOT NULL, field VARCHAR(255) NOT NULL, value LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_3D0509B5313925B6 (form_lead_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE form_lead ADD CONSTRAINT FK_BCB065DCF639F774 FOREIGN KEY (campaign_id) REFERENCES campaign (id)');
$this->addSql('ALTER TABLE form_lead_data ADD CONSTRAINT FK_3D0509B5313925B6 FOREIGN KEY (form_lead_id) REFERENCES form_lead (id)');
$this->addSql('DROP TABLE `lead`');
$this->addSql('DROP TABLE lead_data');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE form_lead_data DROP FOREIGN KEY FK_3D0509B5313925B6');
$this->addSql('CREATE TABLE `lead` (id INT AUTO_INCREMENT NOT NULL, campaign_id INT NOT NULL, uuid BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_289161CBF639F774 (campaign_id), UNIQUE INDEX UNIQ_289161CBD17F50A6 (uuid), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE lead_data (id INT AUTO_INCREMENT NOT NULL, lead_object VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, field VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, value LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE `lead` ADD CONSTRAINT FK_289161CBF639F774 FOREIGN KEY (campaign_id) REFERENCES campaign (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('DROP TABLE form_lead');
$this->addSql('DROP TABLE form_lead_data');
}
}