<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20250422101900 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('member_application')->hasColumn('cmcm_comment'),
'The cmcm_comment column was already added to member_application table!'
);
$commentTable = $schema->getTable('member_application');
$commentTable->addColumn('cmcm_comment', Types::TEXT)->setNotnull(false);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('member_application')->hasColumn('cmcm_comment'),
'The cmcm_comment column was already removed to member_application table!'
);
$commentTable = $schema->getTable('member_application');
$commentTable->dropColumn('cmcm_comment');
}
}