<?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 Version20230830150006 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('alter table blog_post add meta_keywords TEXT default NULL');
}
public function down(Schema $schema): void
{
$this->addSql("create table blog_post_dg_tmp
(
id INTEGER not null
primary key autoincrement,
title VARCHAR(255) not null,
slug VARCHAR(255) not null,
created_at DATETIME not null,
updated_at DATETIME default NULL,
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_dg_tmp(id, title, slug, created_at, updated_at, poster, page_title, meta_description, published, description, short_description, button_text, button_link)
select id, title, slug, created_at, updated_at, poster, page_title, meta_description, published, description, short_description, button_text, button_link
from blog_post
");
$this->addSql("drop table blog_post");
$this->addSql("alter table blog_post_dg_tmp rename to blog_post");
$this->addSql("create unique index UNIQ_BA5AE01D989D9B62 on blog_post (slug)");
}
}