<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20220914134445 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('message')->hasColumn('renderable_content'),
'The renderable_content field was already added in the message table!'
);
$schema->getTable('message')->addColumn(
'renderable_content',
Types::TEXT,
[
'notnull' => false,
'default' => 'null',
]
);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('message')->hasColumn('renderable_content'),
'The renderable_content field was already removed from the message table!'
);
$schema->getTable('message')->dropColumn('renderable_content');
}
}