<?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 Version20211115111452 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 module_page ADD COLUMN updated_at DATETIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_AE36F32C989D9B62');
$this->addSql('CREATE TEMPORARY TABLE __temp__module_page AS SELECT id, slug, title, description, capability_title, capability_text, configure_title, configure_text, tariffs, image, feature_text, feature_image, created_at, page_title, meta_description FROM module_page');
$this->addSql('DROP TABLE module_page');
$this->addSql('CREATE TABLE module_page (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, slug VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, description CLOB NOT NULL, capability_title VARCHAR(255) DEFAULT NULL, capability_text CLOB DEFAULT NULL, configure_title VARCHAR(255) DEFAULT NULL, configure_text CLOB DEFAULT NULL, tariffs CLOB NOT NULL --(DC2Type:json)
, image VARCHAR(255) DEFAULT NULL, feature_text CLOB DEFAULT NULL, feature_image VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL --(DC2Type:datetime_immutable)
, page_title VARCHAR(255) DEFAULT \'\' NOT NULL, meta_description VARCHAR(255) DEFAULT \'\' NOT NULL)');
$this->addSql('INSERT INTO module_page (id, slug, title, description, capability_title, capability_text, configure_title, configure_text, tariffs, image, feature_text, feature_image, created_at, page_title, meta_description) SELECT id, slug, title, description, capability_title, capability_text, configure_title, configure_text, tariffs, image, feature_text, feature_image, created_at, page_title, meta_description FROM __temp__module_page');
$this->addSql('DROP TABLE __temp__module_page');
$this->addSql('CREATE UNIQUE INDEX UNIQ_AE36F32C989D9B62 ON module_page (slug)');
}
}