<?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 Version20220420143729 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 (id INT AUTO_INCREMENT NOT NULL, campaign_id INT NOT NULL, name VARCHAR(255) NOT NULL, definition_file VARCHAR(255) NOT NULL, pre_fil_in_actions VARCHAR(255) NOT NULL, post_fill_in_actions VARCHAR(255) DEFAULT NULL, recurring_actions VARCHAR(255) DEFAULT 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_5288FD4FD17F50A6 (uuid), INDEX IDX_5288FD4FF639F774 (campaign_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$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, UNIQUE INDEX UNIQ_289161CBD17F50A6 (uuid), INDEX IDX_289161CBF639F774 (campaign_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE lead_data (id INT AUTO_INCREMENT NOT NULL, lead_object VARCHAR(255) NOT NULL, field VARCHAR(255) NOT NULL, value LONGTEXT NOT NULL, active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE form ADD CONSTRAINT FK_5288FD4FF639F774 FOREIGN KEY (campaign_id) REFERENCES campaign (id)');
$this->addSql('ALTER TABLE `lead` ADD CONSTRAINT FK_289161CBF639F774 FOREIGN KEY (campaign_id) REFERENCES campaign (id)');
$this->addSql('ALTER TABLE campaign ADD uuid BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1F1512DDD17F50A6 ON campaign (uuid)');
$this->addSql('ALTER TABLE company ADD uuid BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('CREATE UNIQUE INDEX UNIQ_4FBF094FD17F50A6 ON company (uuid)');
$this->addSql('ALTER TABLE user ADD uuid BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649D17F50A6 ON user (uuid)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE form');
$this->addSql('DROP TABLE `lead`');
$this->addSql('DROP TABLE lead_data');
$this->addSql('DROP INDEX UNIQ_1F1512DDD17F50A6 ON campaign');
$this->addSql('ALTER TABLE campaign DROP uuid');
$this->addSql('DROP INDEX UNIQ_4FBF094FD17F50A6 ON company');
$this->addSql('ALTER TABLE company DROP uuid');
$this->addSql('DROP INDEX UNIQ_8D93D649D17F50A6 ON `user`');
$this->addSql('ALTER TABLE `user` DROP uuid');
}
}