<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20220930145423 extends AbstractMigration
{
public function getDescription(): string
{
return 'New table: autocomplete_bic';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->hasTable('autocomplete_bic'),
'The autocomplete_bic table already exists!'
);
$table = $schema->createTable('autocomplete_bic');
$table->addColumn('iban_code', Types::INTEGER, ['length' => 40])->setNotnull(true);
$table->addColumn('bic', Types::STRING, ['length' => 12])->setNotnull(true);
$table->addColumn('credit_institution', Types::STRING, ['length' => 120])->setNotnull(true);
$table->setPrimaryKey(['iban_code']);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->hasTable('autocomplete_bic'),
'The autocomplete_bic table has already been removed!'
);
$schema->dropTable('autocomplete_bic');
}
}