migrations/Version20220905134935.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\Migrations\AbstractMigration;
  6. final class Version20220905134935 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return '';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->skipIf(
  15.             true
  16.             ===
  17.             $schema->getTable('member_application')->hasIndex('idx_member_application_processing_status'),
  18.             'The processing_status index was already added to the member_application table!'
  19.         );
  20.         $schema->getTable('member_application')->addIndex(
  21.             ['processing_status'],
  22.             'idx_member_application_processing_status'
  23.         );
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         $this->skipIf(
  28.             false
  29.             ===
  30.             $schema->getTable('member_application')->hasIndex('idx_member_application_processing_status'),
  31.             'The processing_status index was already removed from the member_application table!'
  32.         );
  33.         $schema->getTable('member_application')->dropIndex(
  34.             'idx_member_application_processing_status'
  35.         );
  36.     }
  37. }