<?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 Version20220617124337 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 choice_pillar_score (id INT AUTO_INCREMENT NOT NULL, choice_id INT NOT NULL, pillar_id INT NOT NULL, score INT NOT NULL, INDEX IDX_D658DCF0998666D1 (choice_id), INDEX IDX_D658DCF0164AAF93 (pillar_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE pillar (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, color VARCHAR(7) NOT NULL, icon VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE choice_pillar_score ADD CONSTRAINT FK_D658DCF0998666D1 FOREIGN KEY (choice_id) REFERENCES choice (id)');
$this->addSql('ALTER TABLE choice_pillar_score ADD CONSTRAINT FK_D658DCF0164AAF93 FOREIGN KEY (pillar_id) REFERENCES pillar (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE choice_pillar_score DROP FOREIGN KEY FK_D658DCF0164AAF93');
$this->addSql('DROP TABLE choice_pillar_score');
$this->addSql('DROP TABLE pillar');
}
}