<?php
declare(strict_types=1);
namespace Boldr\Cms\CmsBundle\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Boldr\Cms\CmsBundle\BoldrCmsMigration;
final class Version1__16_0 extends BoldrCmsMigration
{
public function getBundle(): string { return 'boldr/cms-bundle'; }
public function getVersion(): ?string { return '1.16.0'; }
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cms_page_translation ADD draft_sections LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE cms_page_translation CHANGE sections sections LONGTEXT DEFAULT NULL');
$this->addSql('UPDATE cms_page_translation pt LEFT JOIN cms_page p ON p.id = pt.page_id SET draft_sections = sections, sections = NULL WHERE p.published = 0');
$this->addSql('ALTER TABLE cms_page DROP published');
}
}