<?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 Version20250414155105 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 channel_crm_prospects (
id INT AUTO_INCREMENT NOT NULL,
channel_id VARCHAR(36) NOT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
email VARCHAR(180) NOT NULL,
first_name VARCHAR(255) DEFAULT NULL,
last_name VARCHAR(255) DEFAULT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_D584129F72F5A1AA (channel_id),
INDEX IDX_D584129FB03A8386 (created_by_id),
INDEX IDX_D584129F896DBBDE (updated_by_id),
FULLTEXT INDEX IDX_D584129FE7927C74 (email),
FULLTEXT INDEX IDX_D584129FA9D1C132 (first_name),
FULLTEXT INDEX IDX_D584129FC808BA5A (last_name),
UNIQUE INDEX UNIQ_D584129F72F5A1AAE7927C74 (channel_id, email),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_attempt_answers (
id INT AUTO_INCREMENT NOT NULL,
attempt_block_id INT NOT NULL,
question_id INT DEFAULT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
valid TINYINT(1) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_2DC4DE2681F474AA (attempt_block_id),
INDEX IDX_2DC4DE261E27F6BF (question_id),
INDEX IDX_2DC4DE26B03A8386 (created_by_id),
INDEX IDX_2DC4DE26896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_attempt_answer_selected_answers (
answer_id INT NOT NULL,
question_answer_id INT NOT NULL,
INDEX IDX_45D840D5AA334807 (answer_id),
INDEX IDX_45D840D5A3E60C9C (question_answer_id),
PRIMARY KEY(answer_id, question_answer_id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_attempt_blocks (
id INT AUTO_INCREMENT NOT NULL,
attempt_id INT NOT NULL,
block_id INT DEFAULT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
time INT NOT NULL,
status VARCHAR(255) DEFAULT \'waiting\',
result VARCHAR(255) DEFAULT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_DD6B04F7B191BE6B (attempt_id),
INDEX IDX_DD6B04F7E9ED820C (block_id),
INDEX IDX_DD6B04F7B03A8386 (created_by_id),
INDEX IDX_DD6B04F7896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_attempts (
id INT AUTO_INCREMENT NOT NULL,
prospect_id INT NOT NULL,
positioning_test_id INT DEFAULT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
time INT NOT NULL,
status VARCHAR(255) DEFAULT \'waiting\',
result VARCHAR(255) DEFAULT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_AEEA1A75D182060A (prospect_id),
INDEX IDX_AEEA1A75F5AF274A (positioning_test_id),
INDEX IDX_AEEA1A75B03A8386 (created_by_id),
INDEX IDX_AEEA1A75896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_blocks (
id INT AUTO_INCREMENT NOT NULL,
channel_id VARCHAR(36) NOT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
archived TINYINT(1) NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
estimated_time TIME DEFAULT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_E13EC5C672F5A1AA (channel_id),
INDEX IDX_E13EC5C6B03A8386 (created_by_id),
INDEX IDX_E13EC5C6896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_positioning_test_blocks (
id INT AUTO_INCREMENT NOT NULL,
positioning_test_id INT NOT NULL,
block_id INT NOT NULL,
rank INT NOT NULL,
INDEX IDX_7051C812F5AF274A (positioning_test_id),
INDEX IDX_7051C812E9ED820C (block_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_question_answers (
id INT AUTO_INCREMENT NOT NULL,
question_id INT NOT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
valid TINYINT(1) NOT NULL,
label VARCHAR(255) NOT NULL,
rank INT NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_D06D16D1E27F6BF (question_id),
INDEX IDX_D06D16DB03A8386 (created_by_id),
INDEX IDX_D06D16D896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_test_questions (
id INT AUTO_INCREMENT NOT NULL,
block_id INT NOT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
multiple TINYINT(1) NOT NULL,
label VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
rank INT NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_E07D59DAE9ED820C (block_id),
INDEX IDX_E07D59DAB03A8386 (created_by_id),
INDEX IDX_E07D59DA896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE channel_positioning_tests (
id INT AUTO_INCREMENT NOT NULL,
channel_id VARCHAR(36) NOT NULL,
created_by_id VARCHAR(36) DEFAULT NULL,
updated_by_id VARCHAR(36) DEFAULT NULL,
archived TINYINT(1) NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
break_text TEXT DEFAULT NULL,
fraud_title VARCHAR(255) DEFAULT NULL,
fraud_text TEXT DEFAULT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME DEFAULT NULL,
INDEX IDX_E24E951872F5A1AA (channel_id),
INDEX IDX_E24E9518B03A8386 (created_by_id),
INDEX IDX_E24E9518896DBBDE (updated_by_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE file_positioning_test_question (
id INT NOT NULL,
question_id INT NOT NULL,
INDEX IDX_FF2853CF1E27F6BF (question_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE
channel_crm_prospects
ADD
CONSTRAINT FK_D584129F72F5A1AA FOREIGN KEY (channel_id) REFERENCES channel_channels (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_crm_prospects
ADD
CONSTRAINT FK_D584129FB03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_crm_prospects
ADD
CONSTRAINT FK_D584129F896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answers
ADD
CONSTRAINT FK_2DC4DE2681F474AA FOREIGN KEY (attempt_block_id) REFERENCES channel_positioning_test_attempt_blocks (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answers
ADD
CONSTRAINT FK_2DC4DE261E27F6BF FOREIGN KEY (question_id) REFERENCES channel_positioning_test_questions (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answers
ADD
CONSTRAINT FK_2DC4DE26B03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answers
ADD
CONSTRAINT FK_2DC4DE26896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answer_selected_answers
ADD
CONSTRAINT FK_45D840D5AA334807 FOREIGN KEY (answer_id) REFERENCES channel_positioning_test_attempt_answers (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answer_selected_answers
ADD
CONSTRAINT FK_45D840D5A3E60C9C FOREIGN KEY (question_answer_id) REFERENCES channel_positioning_test_question_answers (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_blocks
ADD
CONSTRAINT FK_DD6B04F7B191BE6B FOREIGN KEY (attempt_id) REFERENCES channel_positioning_test_attempts (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_blocks
ADD
CONSTRAINT FK_DD6B04F7E9ED820C FOREIGN KEY (block_id) REFERENCES channel_positioning_test_blocks (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_blocks
ADD
CONSTRAINT FK_DD6B04F7B03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_blocks
ADD
CONSTRAINT FK_DD6B04F7896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempts
ADD
CONSTRAINT FK_AEEA1A75D182060A FOREIGN KEY (prospect_id) REFERENCES channel_crm_prospects (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_attempts
ADD
CONSTRAINT FK_AEEA1A75F5AF274A FOREIGN KEY (positioning_test_id) REFERENCES channel_positioning_tests (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempts
ADD
CONSTRAINT FK_AEEA1A75B03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_attempts
ADD
CONSTRAINT FK_AEEA1A75896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_blocks
ADD
CONSTRAINT FK_E13EC5C672F5A1AA FOREIGN KEY (channel_id) REFERENCES channel_channels (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_blocks
ADD
CONSTRAINT FK_E13EC5C6B03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_blocks
ADD
CONSTRAINT FK_E13EC5C6896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_positioning_test_blocks
ADD
CONSTRAINT FK_7051C812F5AF274A FOREIGN KEY (positioning_test_id) REFERENCES channel_positioning_tests (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_positioning_test_blocks
ADD
CONSTRAINT FK_7051C812E9ED820C FOREIGN KEY (block_id) REFERENCES channel_positioning_test_blocks (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_question_answers
ADD
CONSTRAINT FK_D06D16D1E27F6BF FOREIGN KEY (question_id) REFERENCES channel_positioning_test_questions (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_question_answers
ADD
CONSTRAINT FK_D06D16DB03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_question_answers
ADD
CONSTRAINT FK_D06D16D896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_questions
ADD
CONSTRAINT FK_E07D59DAE9ED820C FOREIGN KEY (block_id) REFERENCES channel_positioning_test_blocks (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_test_questions
ADD
CONSTRAINT FK_E07D59DAB03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_test_questions
ADD
CONSTRAINT FK_E07D59DA896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_tests
ADD
CONSTRAINT FK_E24E951872F5A1AA FOREIGN KEY (channel_id) REFERENCES channel_channels (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
channel_positioning_tests
ADD
CONSTRAINT FK_E24E9518B03A8386 FOREIGN KEY (created_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
channel_positioning_tests
ADD
CONSTRAINT FK_E24E9518896DBBDE FOREIGN KEY (updated_by_id) REFERENCES account_users (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
file_positioning_test_question
ADD
CONSTRAINT FK_FF2853CF1E27F6BF FOREIGN KEY (question_id) REFERENCES channel_positioning_test_questions (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE
file_positioning_test_question
ADD
CONSTRAINT FK_FF2853CFBF396750 FOREIGN KEY (id) REFERENCES file (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_crm_prospects DROP FOREIGN KEY FK_D584129F72F5A1AA');
$this->addSql('ALTER TABLE channel_crm_prospects DROP FOREIGN KEY FK_D584129FB03A8386');
$this->addSql('ALTER TABLE channel_crm_prospects DROP FOREIGN KEY FK_D584129F896DBBDE');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_answers DROP FOREIGN KEY FK_2DC4DE2681F474AA');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_answers DROP FOREIGN KEY FK_2DC4DE261E27F6BF');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_answers DROP FOREIGN KEY FK_2DC4DE26B03A8386');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_answers DROP FOREIGN KEY FK_2DC4DE26896DBBDE');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answer_selected_answers
DROP
FOREIGN KEY FK_45D840D5AA334807');
$this->addSql('ALTER TABLE
channel_positioning_test_attempt_answer_selected_answers
DROP
FOREIGN KEY FK_45D840D5A3E60C9C');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_blocks DROP FOREIGN KEY FK_DD6B04F7B191BE6B');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_blocks DROP FOREIGN KEY FK_DD6B04F7E9ED820C');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_blocks DROP FOREIGN KEY FK_DD6B04F7B03A8386');
$this->addSql('ALTER TABLE channel_positioning_test_attempt_blocks DROP FOREIGN KEY FK_DD6B04F7896DBBDE');
$this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75D182060A');
$this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75F5AF274A');
$this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75B03A8386');
$this->addSql('ALTER TABLE channel_positioning_test_attempts DROP FOREIGN KEY FK_AEEA1A75896DBBDE');
$this->addSql('ALTER TABLE channel_positioning_test_blocks DROP FOREIGN KEY FK_E13EC5C672F5A1AA');
$this->addSql('ALTER TABLE channel_positioning_test_blocks DROP FOREIGN KEY FK_E13EC5C6B03A8386');
$this->addSql('ALTER TABLE channel_positioning_test_blocks DROP FOREIGN KEY FK_E13EC5C6896DBBDE');
$this->addSql('ALTER TABLE
channel_positioning_test_positioning_test_blocks
DROP
FOREIGN KEY FK_7051C812F5AF274A');
$this->addSql('ALTER TABLE
channel_positioning_test_positioning_test_blocks
DROP
FOREIGN KEY FK_7051C812E9ED820C');
$this->addSql('ALTER TABLE channel_positioning_test_question_answers DROP FOREIGN KEY FK_D06D16D1E27F6BF');
$this->addSql('ALTER TABLE channel_positioning_test_question_answers DROP FOREIGN KEY FK_D06D16DB03A8386');
$this->addSql('ALTER TABLE channel_positioning_test_question_answers DROP FOREIGN KEY FK_D06D16D896DBBDE');
$this->addSql('ALTER TABLE channel_positioning_test_questions DROP FOREIGN KEY FK_E07D59DAE9ED820C');
$this->addSql('ALTER TABLE channel_positioning_test_questions DROP FOREIGN KEY FK_E07D59DAB03A8386');
$this->addSql('ALTER TABLE channel_positioning_test_questions DROP FOREIGN KEY FK_E07D59DA896DBBDE');
$this->addSql('ALTER TABLE channel_positioning_tests DROP FOREIGN KEY FK_E24E951872F5A1AA');
$this->addSql('ALTER TABLE channel_positioning_tests DROP FOREIGN KEY FK_E24E9518B03A8386');
$this->addSql('ALTER TABLE channel_positioning_tests DROP FOREIGN KEY FK_E24E9518896DBBDE');
$this->addSql('ALTER TABLE file_positioning_test_question DROP FOREIGN KEY FK_FF2853CF1E27F6BF');
$this->addSql('ALTER TABLE file_positioning_test_question DROP FOREIGN KEY FK_FF2853CFBF396750');
$this->addSql('DROP TABLE channel_crm_prospects');
$this->addSql('DROP TABLE channel_positioning_test_attempt_answers');
$this->addSql('DROP TABLE channel_positioning_test_attempt_answer_selected_answers');
$this->addSql('DROP TABLE channel_positioning_test_attempt_blocks');
$this->addSql('DROP TABLE channel_positioning_test_attempts');
$this->addSql('DROP TABLE channel_positioning_test_blocks');
$this->addSql('DROP TABLE channel_positioning_test_positioning_test_blocks');
$this->addSql('DROP TABLE channel_positioning_test_question_answers');
$this->addSql('DROP TABLE channel_positioning_test_questions');
$this->addSql('DROP TABLE channel_positioning_tests');
$this->addSql('DROP TABLE file_positioning_test_question');
}
}