<?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 Version20220623132116 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 subThemes (theme_id INT NOT NULL, subTheme_theme_id INT NOT NULL, INDEX IDX_7492BFCD59027487 (theme_id), INDEX IDX_7492BFCD56A599D8 (subTheme_theme_id), PRIMARY KEY(theme_id, subTheme_theme_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE subThemes ADD CONSTRAINT FK_7492BFCD59027487 FOREIGN KEY (theme_id) REFERENCES theme (id)');
$this->addSql('ALTER TABLE subThemes ADD CONSTRAINT FK_7492BFCD56A599D8 FOREIGN KEY (subTheme_theme_id) REFERENCES theme (id)');
$this->addSql('DROP TABLE subCategories');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE subCategories (theme_id INT NOT NULL, subCategory_id INT NOT NULL, INDEX IDX_2A3FA21B59027487 (theme_id), INDEX IDX_2A3FA21BDB5A7180 (subCategory_id), PRIMARY KEY(theme_id, subCategory_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE subCategories ADD CONSTRAINT FK_2A3FA21BDB5A7180 FOREIGN KEY (subCategory_id) REFERENCES theme (id)');
$this->addSql('ALTER TABLE subCategories ADD CONSTRAINT FK_2A3FA21B59027487 FOREIGN KEY (theme_id) REFERENCES theme (id)');
$this->addSql('DROP TABLE subThemes');
}
}