<?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 Version20221218133028 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 TEMPORARY TABLE __temp__blog_post AS SELECT id, title, slug, created_at, updated_at, poster, page_title, meta_description, published FROM blog_post');
$this->addSql('DROP TABLE blog_post');
$this->addSql('CREATE TABLE blog_post (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, title VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, updated_at DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
, poster VARCHAR(255) DEFAULT NULL, page_title VARCHAR(255) DEFAULT \'\' NOT NULL, meta_description VARCHAR(255) DEFAULT \'\' NOT NULL, published BOOLEAN NOT NULL, description CLOB DEFAULT NULL, short_description CLOB DEFAULT NULL, button_text VARCHAR(255) DEFAULT NULL, button_link VARCHAR(255) DEFAULT NULL)');
$this->addSql('INSERT INTO blog_post (id, title, slug, created_at, updated_at, poster, page_title, meta_description, published) SELECT id, title, slug, created_at, updated_at, poster, page_title, meta_description, published FROM __temp__blog_post');
$this->addSql('DROP TABLE __temp__blog_post');
$this->addSql('CREATE UNIQUE INDEX UNIQ_BA5AE01D989D9B62 ON blog_post (slug)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TEMPORARY TABLE __temp__blog_post AS SELECT id, title, slug, created_at, updated_at, poster, published, page_title, meta_description FROM blog_post');
$this->addSql('DROP TABLE blog_post');
$this->addSql('CREATE TABLE blog_post (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, title VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, updated_at DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
, poster VARCHAR(255) DEFAULT NULL, published BOOLEAN DEFAULT 0 NOT NULL, page_title VARCHAR(255) DEFAULT \'\' NOT NULL, meta_description VARCHAR(255) DEFAULT \'\' NOT NULL)');
$this->addSql('INSERT INTO blog_post (id, title, slug, created_at, updated_at, poster, published, page_title, meta_description) SELECT id, title, slug, created_at, updated_at, poster, published, page_title, meta_description FROM __temp__blog_post');
$this->addSql('DROP TABLE __temp__blog_post');
$this->addSql('CREATE UNIQUE INDEX UNIQ_BA5AE01D989D9B62 ON blog_post (slug)');
}
}