<?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 Version20220118153006 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 cal_question_answer (id INT AUTO_INCREMENT NOT NULL, question_id INT DEFAULT NULL, answer_id INT DEFAULT NULL, position INT NOT NULL, UNIQUE INDEX UNIQ_B0565D801E27F6BF (question_id), UNIQUE INDEX UNIQ_B0565D80AA334807 (answer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE cal_question_answer ADD CONSTRAINT FK_B0565D801E27F6BF FOREIGN KEY (question_id) REFERENCES cal_translation (id)');
$this->addSql('ALTER TABLE cal_question_answer ADD CONSTRAINT FK_B0565D80AA334807 FOREIGN KEY (answer_id) REFERENCES cal_translation (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE cal_question_answer');
}
}