<?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 Version20210806113625 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 calendar_code (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(15) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE configuration (id INT AUTO_INCREMENT NOT NULL, api_url VARCHAR(255) DEFAULT NULL, api_username VARCHAR(255) DEFAULT NULL, api_password VARCHAR(255) DEFAULT NULL, web_app_url VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE configuration_disposition_code (configuration_id INT NOT NULL, disposition_code_id INT NOT NULL, INDEX IDX_EEA89E9C73F32DD8 (configuration_id), INDEX IDX_EEA89E9C289ABF4A (disposition_code_id), PRIMARY KEY(configuration_id, disposition_code_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE configuration_pleading_code (configuration_id INT NOT NULL, pleading_code_id INT NOT NULL, INDEX IDX_2F65025A73F32DD8 (configuration_id), INDEX IDX_2F65025A2E5C11B3 (pleading_code_id), PRIMARY KEY(configuration_id, pleading_code_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE configuration_calendar_code (configuration_id INT NOT NULL, calendar_code_id INT NOT NULL, INDEX IDX_61D92BD173F32DD8 (configuration_id), INDEX IDX_61D92BD145AD85D0 (calendar_code_id), PRIMARY KEY(configuration_id, calendar_code_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE configuration_report_code (configuration_id INT NOT NULL, report_code_id INT NOT NULL, INDEX IDX_6FAEBF1B73F32DD8 (configuration_id), INDEX IDX_6FAEBF1B47438317 (report_code_id), PRIMARY KEY(configuration_id, report_code_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE disposition_code (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(15) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE pleading_code (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(15) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE report_code (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(15) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE configuration_disposition_code ADD CONSTRAINT FK_EEA89E9C73F32DD8 FOREIGN KEY (configuration_id) REFERENCES configuration (id)');
$this->addSql('ALTER TABLE configuration_disposition_code ADD CONSTRAINT FK_EEA89E9C289ABF4A FOREIGN KEY (disposition_code_id) REFERENCES disposition_code (id)');
$this->addSql('ALTER TABLE configuration_pleading_code ADD CONSTRAINT FK_2F65025A73F32DD8 FOREIGN KEY (configuration_id) REFERENCES configuration (id)');
$this->addSql('ALTER TABLE configuration_pleading_code ADD CONSTRAINT FK_2F65025A2E5C11B3 FOREIGN KEY (pleading_code_id) REFERENCES pleading_code (id)');
$this->addSql('ALTER TABLE configuration_calendar_code ADD CONSTRAINT FK_61D92BD173F32DD8 FOREIGN KEY (configuration_id) REFERENCES configuration (id)');
$this->addSql('ALTER TABLE configuration_calendar_code ADD CONSTRAINT FK_61D92BD145AD85D0 FOREIGN KEY (calendar_code_id) REFERENCES calendar_code (id)');
$this->addSql('ALTER TABLE configuration_report_code ADD CONSTRAINT FK_6FAEBF1B73F32DD8 FOREIGN KEY (configuration_id) REFERENCES configuration (id)');
$this->addSql('ALTER TABLE configuration_report_code ADD CONSTRAINT FK_6FAEBF1B47438317 FOREIGN KEY (report_code_id) REFERENCES report_code (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE configuration_calendar_code DROP FOREIGN KEY FK_61D92BD145AD85D0');
$this->addSql('ALTER TABLE configuration_disposition_code DROP FOREIGN KEY FK_EEA89E9C73F32DD8');
$this->addSql('ALTER TABLE configuration_pleading_code DROP FOREIGN KEY FK_2F65025A73F32DD8');
$this->addSql('ALTER TABLE configuration_calendar_code DROP FOREIGN KEY FK_61D92BD173F32DD8');
$this->addSql('ALTER TABLE configuration_report_code DROP FOREIGN KEY FK_6FAEBF1B73F32DD8');
$this->addSql('ALTER TABLE configuration_disposition_code DROP FOREIGN KEY FK_EEA89E9C289ABF4A');
$this->addSql('ALTER TABLE configuration_pleading_code DROP FOREIGN KEY FK_2F65025A2E5C11B3');
$this->addSql('ALTER TABLE configuration_report_code DROP FOREIGN KEY FK_6FAEBF1B47438317');
$this->addSql('DROP TABLE calendar_code');
$this->addSql('DROP TABLE configuration');
$this->addSql('DROP TABLE configuration_disposition_code');
$this->addSql('DROP TABLE configuration_pleading_code');
$this->addSql('DROP TABLE configuration_calendar_code');
$this->addSql('DROP TABLE configuration_report_code');
$this->addSql('DROP TABLE disposition_code');
$this->addSql('DROP TABLE pleading_code');
$this->addSql('DROP TABLE report_code');
$this->addSql('ALTER TABLE chambervote DROP FOREIGN KEY FK_DC210F2E9FAF8308');
$this->addSql('ALTER TABLE chambervote DROP FOREIGN KEY FK_DC210F2E72DCDAFC');
$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 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');
}
}