migrations/Version20251127210000.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 Version20251127210000 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return 'Add description and read_more_url fields to subscription_plan_translation table';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $table $schema->getTable('subscription_plan_translation');
  16.         $this->skipIf(
  17.             $table->hasColumn('description'),
  18.             'The description column already exists in the subscription_plan_translation table'
  19.         );
  20.         $table->addColumn('description'Types::TEXT)
  21.             ->setNotnull(false);
  22.         $table->addColumn('read_more_url'Types::STRING)
  23.             ->setLength(255)
  24.             ->setNotnull(false);
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         $table $schema->getTable('subscription_plan_translation');
  29.         $this->skipIf(
  30.             !$table->hasColumn('description'),
  31.             'The description column does not exist in the subscription_plan_translation table'
  32.         );
  33.         $table->dropColumn('description');
  34.         $table->dropColumn('read_more_url');
  35.     }
  36. }