<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20241029124702 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add is_complementary_insurance_information_checked to member_application table';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('member_application')->hasColumn('is_complementary_insurance_information_checked'),
'The is_complementary_insurance_information_checked field already exists in the member_application table!'
);
$memberApplicationTable = $schema->getTable('member_application');
$memberApplicationTable->addColumn('is_complementary_insurance_information_checked', Types::BOOLEAN)->setNotnull(true)->setDefault(false);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('member_application')->hasColumn('is_complementary_insurance_information_checked'),
'The is_complementary_insurance_information_checked is already removed from the member_application table!'
);
$memberApplicationTable = $schema->getTable('member_application');
$memberApplicationTable->dropColumn('is_complementary_insurance_information_checked');
}
}