<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20251209150000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add member_comment field to cmcm_request table';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('cmcm_request');
$this->skipIf(
$table->hasColumn('member_comment'),
'The member_comment column already exists in the cmcm_request table'
);
$table->addColumn('member_comment', Types::TEXT)
->setNotnull(false);
}
public function down(Schema $schema): void
{
$table = $schema->getTable('cmcm_request');
$this->skipIf(
!$table->hasColumn('member_comment'),
'The member_comment column does not exist in the cmcm_request table'
);
$table->dropColumn('member_comment');
}
}