migrations/Version20221223112740.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20221223112740 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('ALTER TABLE wiki_post_category DROP FOREIGN KEY FK_CD92DF8D4B89032C');$this->addSql('ALTER TABLE wiki_post_category DROP FOREIGN KEY FK_CD92DF8D12469DE2');$this->addSql('DROP INDEX `primary` ON wiki_post_category');$this->addSql('ALTER TABLE wiki_post_category ADD CONSTRAINT FK_CD92DF8D4B89032C FOREIGN KEY (post_id) REFERENCES wiki_post (id)');$this->addSql('ALTER TABLE wiki_post_category ADD CONSTRAINT FK_CD92DF8D12469DE2 FOREIGN KEY (category_id) REFERENCES wiki_category (id)');$this->addSql('ALTER TABLE wiki_post_category ADD PRIMARY KEY (post_id, category_id)');$this->addSql('ALTER TABLE wiki_post_tag DROP FOREIGN KEY FK_B1083F3F4B89032C');$this->addSql('ALTER TABLE wiki_post_tag DROP FOREIGN KEY FK_B1083F3FBAD26311');$this->addSql('DROP INDEX `primary` ON wiki_post_tag');$this->addSql('ALTER TABLE wiki_post_tag ADD CONSTRAINT FK_B1083F3F4B89032C FOREIGN KEY (post_id) REFERENCES wiki_post (id)');$this->addSql('ALTER TABLE wiki_post_tag ADD CONSTRAINT FK_B1083F3FBAD26311 FOREIGN KEY (tag_id) REFERENCES wiki_tag (id)');$this->addSql('ALTER TABLE wiki_post_tag ADD PRIMARY KEY (post_id, tag_id)');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE wiki_post_category DROP FOREIGN KEY FK_CD92DF8D4B89032C');$this->addSql('ALTER TABLE wiki_post_category DROP FOREIGN KEY FK_CD92DF8D12469DE2');$this->addSql('DROP INDEX `PRIMARY` ON wiki_post_category');$this->addSql('ALTER TABLE wiki_post_category ADD CONSTRAINT FK_CD92DF8D4B89032C FOREIGN KEY (post_id) REFERENCES wiki_category (id)');$this->addSql('ALTER TABLE wiki_post_category ADD CONSTRAINT FK_CD92DF8D12469DE2 FOREIGN KEY (category_id) REFERENCES wiki_post (id)');$this->addSql('ALTER TABLE wiki_post_category ADD PRIMARY KEY (category_id, post_id)');$this->addSql('ALTER TABLE wiki_post_tag DROP FOREIGN KEY FK_B1083F3F4B89032C');$this->addSql('ALTER TABLE wiki_post_tag DROP FOREIGN KEY FK_B1083F3FBAD26311');$this->addSql('DROP INDEX `PRIMARY` ON wiki_post_tag');$this->addSql('ALTER TABLE wiki_post_tag ADD CONSTRAINT FK_B1083F3F4B89032C FOREIGN KEY (post_id) REFERENCES wiki_tag (id)');$this->addSql('ALTER TABLE wiki_post_tag ADD CONSTRAINT FK_B1083F3FBAD26311 FOREIGN KEY (tag_id) REFERENCES wiki_post (id)');$this->addSql('ALTER TABLE wiki_post_tag ADD PRIMARY KEY (tag_id, post_id)');}}