<?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 Version20240620134617 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 game_quiz_question_category_mapping (game_quiz_question_id INT NOT NULL, game_category_id INT NOT NULL, INDEX IDX_AFE53FE0F102203 (game_quiz_question_id), INDEX IDX_AFE53FE0CC13DFE0 (game_category_id), PRIMARY KEY(game_quiz_question_id, game_category_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE game_quiz_question_category_mapping ADD CONSTRAINT FK_AFE53FE0F102203 FOREIGN KEY (game_quiz_question_id) REFERENCES game_quiz_question (id)');
$this->addSql('ALTER TABLE game_quiz_question_category_mapping ADD CONSTRAINT FK_AFE53FE0CC13DFE0 FOREIGN KEY (game_category_id) REFERENCES game_category (id)');
$this->addSql('ALTER TABLE game_quiz_category_mapping DROP FOREIGN KEY FK_80C2772ACC13DFE0');
$this->addSql('ALTER TABLE game_quiz_category_mapping DROP FOREIGN KEY FK_80C2772AF102203');
$this->addSql('DROP TABLE game_quiz_category_mapping');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE game_quiz_category_mapping (game_quiz_question_id INT NOT NULL, game_category_id INT NOT NULL, INDEX IDX_80C2772AF102203 (game_quiz_question_id), INDEX IDX_80C2772ACC13DFE0 (game_category_id), PRIMARY KEY(game_quiz_question_id, game_category_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE game_quiz_category_mapping ADD CONSTRAINT FK_80C2772ACC13DFE0 FOREIGN KEY (game_category_id) REFERENCES game_category (id)');
$this->addSql('ALTER TABLE game_quiz_category_mapping ADD CONSTRAINT FK_80C2772AF102203 FOREIGN KEY (game_quiz_question_id) REFERENCES game_quiz_question (id)');
$this->addSql('ALTER TABLE game_quiz_question_category_mapping DROP FOREIGN KEY FK_AFE53FE0F102203');
$this->addSql('ALTER TABLE game_quiz_question_category_mapping DROP FOREIGN KEY FK_AFE53FE0CC13DFE0');
$this->addSql('DROP TABLE game_quiz_question_category_mapping');
}
}