<?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 Version20220914081709 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 tag_groups (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tag_groups_articles (tag_groups_id INT NOT NULL, articles_id INT NOT NULL, INDEX IDX_85EF57411E0007E8 (tag_groups_id), INDEX IDX_85EF57411EBAF6CC (articles_id), PRIMARY KEY(tag_groups_id, articles_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE tag_groups_articles ADD CONSTRAINT FK_85EF57411E0007E8 FOREIGN KEY (tag_groups_id) REFERENCES tag_groups (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tag_groups_articles ADD CONSTRAINT FK_85EF57411EBAF6CC FOREIGN KEY (articles_id) REFERENCES articles (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE item_groups ADD hidden TINYINT(1) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tag_groups_articles DROP FOREIGN KEY FK_85EF57411E0007E8');
$this->addSql('ALTER TABLE tag_groups_articles DROP FOREIGN KEY FK_85EF57411EBAF6CC');
$this->addSql('DROP TABLE tag_groups');
$this->addSql('DROP TABLE tag_groups_articles');
$this->addSql('ALTER TABLE item_groups DROP hidden');
}
}