migrations/Version20220902112722.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 Version20220902112722 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return '';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $this->skipIf(
  16.             true
  17.             ===
  18.             $schema->getTable('member_application')->hasColumn('processing_status'),
  19.             'The processing_status field was already added to the member_application table!'
  20.         );
  21.         $schema->getTable('member_application')->addColumn('processing_status'Types::STRING, [
  22.             'length' => 255,
  23.             'notnull' => true,
  24.             'default' => 'processing',
  25.         ]);
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         $this->skipIf(
  30.             false
  31.             ===
  32.             $schema->getTable('member_application')->hasColumn('processing_status'),
  33.             'The processing_status field was already removed from the member_application table!'
  34.         );
  35.         $schema->getTable('member_application')->dropColumn('processing_status');
  36.     }
  37. }