<?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 Version20220114013157 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 card_file');
$this->addSql('DROP TABLE category_file');
$this->addSql('DROP TABLE chamber_judge');
$this->addSql('DROP TABLE mc_page');
$this->addSql('DROP TABLE page');
$this->addSql('ALTER TABLE customer DROP deleted_at, CHANGE email email VARCHAR(255) NOT NULL, CHANGE roles roles LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
$this->addSql('ALTER TABLE file CHANGE size size INT DEFAULT NULL');
$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 mc_admin CHANGE email email VARCHAR(255) NOT NULL, CHANGE roles roles LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE card_file (card_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_60AC34B293CB796C (file_id), INDEX IDX_60AC34B24ACC9A20 (card_id), PRIMARY KEY(card_id, file_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE category_file (category_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_7044C5793CB796C (file_id), INDEX IDX_7044C5712469DE2 (category_id), PRIMARY KEY(category_id, file_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE chamber_judge (judge_id INT NOT NULL, chamber_id INT NOT NULL, INDEX IDX_9C38640884195BE0 (chamber_id), INDEX IDX_9C386408B7D66194 (judge_id), PRIMARY KEY(judge_id, chamber_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE mc_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 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('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 chambervote DROP FOREIGN KEY FK_DC210F2E9FAF8308');
$this->addSql('ALTER TABLE chambervote DROP FOREIGN KEY FK_DC210F2E72DCDAFC');
$this->addSql('ALTER TABLE customer ADD deleted_at DATETIME DEFAULT NULL, CHANGE email email VARCHAR(180) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, CHANGE roles roles LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\'');
$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 file CHANGE size size INT NOT 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 mc_admin CHANGE email email VARCHAR(180) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, CHANGE roles roles LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\'');
$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');
}
}