migrations/Version20240627152200.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 Version20240627152200 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return 'Add member application process table';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $this->skipIf($schema->hasTable('member_application_process'), 'Table member_application_process already exists');
  16.         $table $schema->createTable('member_application_process');
  17.         $table->addColumn('id'Types::GUID)->setNotnull(true);
  18.         $table->addColumn('member_application_id'Types::INTEGER)->setNotnull(false);
  19.         $table->addColumn('is_form_complete'Types::BOOLEAN)->setNotnull(true)->setDefault(false);
  20.         $table->addColumn('is_b2b_form'Types::BOOLEAN)->setNotnull(true)->setDefault(false);
  21.         $table->setPrimaryKey(['id']);
  22.         $table->addForeignKeyConstraint('process', ['id'], ['id'], ['onDelete' => 'CASCADE'], 'fk_process_member_application_process');
  23.         $table->addForeignKeyConstraint('member_application', ['member_application_id'], ['id'], [], 'fk_member_application_process');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         $this->skipIf(!$schema->hasTable('member_application_process'), 'Table member_application_process does not exist');
  28.         $schema->dropTable('member_application_process');
  29.     }
  30. }