migrations/Version20251209150000.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\Migrations\AbstractMigration;
  7. final class Version20251209150000 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return 'Add member_comment field to cmcm_request table';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $table $schema->getTable('cmcm_request');
  16.         $this->skipIf(
  17.             $table->hasColumn('member_comment'),
  18.             'The member_comment column already exists in the cmcm_request table'
  19.         );
  20.         $table->addColumn('member_comment'Types::TEXT)
  21.             ->setNotnull(false);
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $table $schema->getTable('cmcm_request');
  26.         $this->skipIf(
  27.             !$table->hasColumn('member_comment'),
  28.             'The member_comment column does not exist in the cmcm_request table'
  29.         );
  30.         $table->dropColumn('member_comment');
  31.     }
  32. }