<?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 Version20220425123215 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 media__media CHANGE provider_metadata provider_metadata JSON DEFAULT NULL');
$this->addSql('ALTER TABLE page ADD old_quizz_id INT DEFAULT NULL, ADD young_quizz_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620D18B8FE0 FOREIGN KEY (old_quizz_id) REFERENCES quizz (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620432B7479 FOREIGN KEY (young_quizz_id) REFERENCES quizz (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_140AB620D18B8FE0 ON page (old_quizz_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_140AB620432B7479 ON page (young_quizz_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE media__media CHANGE provider_metadata provider_metadata JSON DEFAULT NULL');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620D18B8FE0');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620432B7479');
$this->addSql('DROP INDEX UNIQ_140AB620D18B8FE0 ON page');
$this->addSql('DROP INDEX UNIQ_140AB620432B7479 ON page');
$this->addSql('ALTER TABLE page DROP old_quizz_id, DROP young_quizz_id');
}
}