migrations/Version20250814145236.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 Version20250814145236 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return 'Add is_ged_import field to inquiry table to track GED imported inquiries';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $this->skipIf(
  16.             $schema->getTable('inquiry')->hasColumn('is_ged_import'),
  17.             'The is_ged_import column already exists in the inquiry table'
  18.         );
  19.         // Add the new is_ged_import column
  20.         $table $schema->getTable('inquiry');
  21.         $table->addColumn('is_ged_import'Types::BOOLEAN)
  22.             ->setDefault(false)
  23.             ->setNotnull(true);
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         $this->skipIf(
  28.             !$schema->getTable('inquiry')->hasColumn('is_ged_import'),
  29.             'The is_ged_import column does not exist in the inquiry table'
  30.         );
  31.         // Drop the is_ged_import column
  32.         $table $schema->getTable('inquiry');
  33.         $table->dropColumn('is_ged_import');
  34.     }
  35. }