<?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 Version20210727165937 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 TABLE IF EXISTS card_file');
$this->addSql('DROP TABLE IF EXISTS category_file');
$this->addSql('DROP TABLE IF EXISTS chamber_judge');
$this->addSql('DROP TABLE IF EXISTS homecard_role');
$this->addSql('DROP TABLE IF EXISTS mc_page');
$this->addSql('DROP TABLE IF EXISTS page');
$this->addSql('ALTER TABLE customer CHANGE enabled enabled TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE gtc_page DROP deleted_at');
$this->addSql('ALTER TABLE page_groups DROP FOREIGN KEY FK_9FBBCF6EC4663E4');
$this->addSql('ALTER TABLE page_groups DROP FOREIGN KEY FK_9FBBCF6EFE54D947');
$this->addSql('ALTER TABLE page_groups ADD CONSTRAINT FK_9FBBCF6EC4663E4 FOREIGN KEY (page_id) REFERENCES gtc_page (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE page_groups ADD CONSTRAINT FK_9FBBCF6EFE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE homecard_group DROP FOREIGN KEY FK_66BC6D5A43FB141E');
$this->addSql('ALTER TABLE homecard_group DROP FOREIGN KEY FK_66BC6D5AFE54D947');
$this->addSql('ALTER TABLE homecard_group ADD CONSTRAINT FK_66BC6D5A43FB141E FOREIGN KEY (homecard_id) REFERENCES home_card (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE homecard_group ADD CONSTRAINT FK_66BC6D5AFE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE judgement_customers DROP FOREIGN KEY FK_3FC9CCC19395C3F3');
$this->addSql('ALTER TABLE judgement_customers DROP FOREIGN KEY FK_3FC9CCC1B63A6766');
$this->addSql('ALTER TABLE judgement_customers ADD CONSTRAINT FK_3FC9CCC19395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE judgement_customers ADD CONSTRAINT FK_3FC9CCC1B63A6766 FOREIGN KEY (judgement_project_id) REFERENCES judgement_project (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE mc_admin CHANGE enabled enabled TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE menu_category_item DROP FOREIGN KEY FK_32430ACF727ACA70');
$this->addSql('ALTER TABLE menu_category_item ADD CONSTRAINT FK_32430ACF727ACA70 FOREIGN KEY (parent_id) REFERENCES menu_category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE group_role DROP FOREIGN KEY FK_7E33D11AD60322AC');
$this->addSql('ALTER TABLE group_role DROP FOREIGN KEY FK_7E33D11AFE54D947');
$this->addSql('ALTER TABLE group_role ADD CONSTRAINT FK_7E33D11AD60322AC FOREIGN KEY (role_id) REFERENCES role (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE group_role ADD CONSTRAINT FK_7E33D11AFE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE IF NOT EXISTScard_file (card_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_60AC34B24ACC9A20 (card_id), INDEX IDX_60AC34B293CB796C (file_id), PRIMARY KEY(card_id, file_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE IF NOT EXISTScategory_file (category_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_7044C5712469DE2 (category_id), INDEX IDX_7044C5793CB796C (file_id), PRIMARY KEY(category_id, file_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE IF NOT EXISTSchamber_judge (judge_id INT NOT NULL, chamber_id INT NOT NULL, INDEX IDX_9C386408B7D66194 (judge_id), INDEX IDX_9C38640884195BE0 (chamber_id), PRIMARY KEY(judge_id, chamber_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE IF NOT EXISTSIF NOT EXISTS homecard_role (homecard_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_F09F34A543FB141E (homecard_id), INDEX IDX_F09F34A5FE54D947 (group_id), PRIMARY KEY(homecard_id, group_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE IF NOT EXISTSmc_page (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, slug VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, active TINYINT(1) NOT NULL, meta_title VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, meta_description VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, content LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, created_at DATETIME DEFAULT NULL, edited_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE IF NOT EXISTSpage (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, slug VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, active TINYINT(1) NOT NULL, meta_title VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, meta_description VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, content LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, created_at DATETIME DEFAULT NULL, edited_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE card_file ADD CONSTRAINT FK_60AC34B293CB796C FOREIGN KEY (file_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE category_file ADD CONSTRAINT FK_7044C5712469DE2 FOREIGN KEY (category_id) REFERENCES category (id)');
$this->addSql('ALTER TABLE category_file ADD CONSTRAINT FK_7044C5793CB796C FOREIGN KEY (file_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE chamber_judge ADD CONSTRAINT FK_9C38640884195BE0 FOREIGN KEY (chamber_id) REFERENCES chamber (id)');
$this->addSql('ALTER TABLE chamber_judge ADD CONSTRAINT FK_9C386408B7D66194 FOREIGN KEY (judge_id) REFERENCES judge (id)');
$this->addSql('ALTER TABLE homecard_role ADD CONSTRAINT FK_F09F34A543FB141E FOREIGN KEY (homecard_id) REFERENCES home_card (id)');
$this->addSql('ALTER TABLE homecard_role ADD CONSTRAINT FK_F09F34A5FE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id)');
$this->addSql('ALTER TABLE chambervote DROP FOREIGN KEY FK_DC210F2E9FAF8308');
$this->addSql('ALTER TABLE chambervote DROP FOREIGN KEY FK_DC210F2E72DCDAFC');
$this->addSql('ALTER TABLE customer CHANGE enabled enabled VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');
$this->addSql('ALTER TABLE desiderata_desideratachamber DROP FOREIGN KEY FK_E944A53CCEE5FDB');
$this->addSql('ALTER TABLE desiderata_desideratachamber DROP FOREIGN KEY FK_E944A53C9FAF8308');
$this->addSql('ALTER TABLE desideratachamber DROP FOREIGN KEY FK_365B36D1CEE5FDB');
$this->addSql('ALTER TABLE group_role DROP FOREIGN KEY FK_7E33D11AFE54D947');
$this->addSql('ALTER TABLE group_role DROP FOREIGN KEY FK_7E33D11AD60322AC');
$this->addSql('ALTER TABLE group_role ADD CONSTRAINT FK_7E33D11AFE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id)');
$this->addSql('ALTER TABLE group_role ADD CONSTRAINT FK_7E33D11AD60322AC FOREIGN KEY (role_id) REFERENCES role (id)');
$this->addSql('ALTER TABLE gtc_page ADD deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE homecard_group DROP FOREIGN KEY FK_66BC6D5A43FB141E');
$this->addSql('ALTER TABLE homecard_group DROP FOREIGN KEY FK_66BC6D5AFE54D947');
$this->addSql('ALTER TABLE homecard_group ADD CONSTRAINT FK_66BC6D5A43FB141E FOREIGN KEY (homecard_id) REFERENCES home_card (id)');
$this->addSql('ALTER TABLE homecard_group ADD CONSTRAINT FK_66BC6D5AFE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id)');
$this->addSql('ALTER TABLE judgement_customers DROP FOREIGN KEY FK_3FC9CCC1B63A6766');
$this->addSql('ALTER TABLE judgement_customers DROP FOREIGN KEY FK_3FC9CCC19395C3F3');
$this->addSql('ALTER TABLE judgement_customers ADD CONSTRAINT FK_3FC9CCC1B63A6766 FOREIGN KEY (judgement_project_id) REFERENCES judgement_project (id)');
$this->addSql('ALTER TABLE judgement_customers ADD CONSTRAINT FK_3FC9CCC19395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE mc_admin CHANGE enabled enabled VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');
$this->addSql('ALTER TABLE menu_category_item DROP FOREIGN KEY FK_32430ACF727ACA70');
$this->addSql('ALTER TABLE menu_category_item ADD CONSTRAINT FK_32430ACF727ACA70 FOREIGN KEY (parent_id) REFERENCES menu_category (id)');
$this->addSql('ALTER TABLE page_groups DROP FOREIGN KEY FK_9FBBCF6EC4663E4');
$this->addSql('ALTER TABLE page_groups DROP FOREIGN KEY FK_9FBBCF6EFE54D947');
$this->addSql('ALTER TABLE page_groups ADD CONSTRAINT FK_9FBBCF6EC4663E4 FOREIGN KEY (page_id) REFERENCES gtc_page (id)');
$this->addSql('ALTER TABLE page_groups ADD CONSTRAINT FK_9FBBCF6EFE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id)');
$this->addSql('ALTER TABLE vote DROP FOREIGN KEY FK_5A10856499601F51');
$this->addSql('ALTER TABLE vote DROP FOREIGN KEY FK_5A108564CEE5FDB');
$this->addSql('ALTER TABLE vote_chambervote DROP FOREIGN KEY FK_6FAC397A72DCDAFC');
$this->addSql('ALTER TABLE vote_chambervote DROP FOREIGN KEY FK_6FAC397A9F63A297');
}
}