<?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 Version20220719094628 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 page ADD is_blog_page TINYINT(1) DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX only_one_blog_page ON page (is_blog_page)');
$this->addSql('DROP INDEX unique_page_url_locale ON page_translation');
$this->addSql('CREATE UNIQUE INDEX unique_page_url_locale ON page_translation (url, locale)');
$this->addSql('ALTER TABLE settings ADD text JSON DEFAULT NULL, ADD anchors JSON DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX only_one_blog_page ON page');
$this->addSql('ALTER TABLE page DROP is_blog_page');
$this->addSql('DROP INDEX unique_page_url_locale ON page_translation');
$this->addSql('CREATE UNIQUE INDEX unique_page_url_locale ON page_translation (url, locale)');
$this->addSql('ALTER TABLE settings DROP text, DROP anchors');
}
}