<?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 Version20230529081305 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('alter table blog_content add video_link TEXT default NULL');
}
public function down(Schema $schema): void
{
$this->addSql('create table blog_content_dg_tmp
(
id INTEGER not null
primary key autoincrement,
post_id INTEGER not null,
title VARCHAR(255) not null,
text CLOB not null,
updated_at DATETIME default NULL,
created_at DATETIME not null,
image_name VARCHAR(255) default NULL,
image_original_name VARCHAR(255) default NULL,
image_mime_type VARCHAR(255) default NULL,
image_size INTEGER default NULL,
image_dimensions CLOB default NULL
)');
$this->addSql('insert into blog_content_dg_tmp(id, post_id, title, text, updated_at, created_at, image_name, image_original_name,
image_mime_type, image_size, image_dimensions)
select id,
post_id,
title,
text,
updated_at,
created_at,
image_name,
image_original_name,
image_mime_type,
image_size,
image_dimensions
from blog_content');
$this->addSql('drop table blog_content');
$this->addSql('alter table blog_content_dg_tmp rename to blog_content');
$this->addSql('create index IDX_12338D2A4B89032C on blog_content (post_id)');
}
}