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