<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20220905142731 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('member_application')->hasColumn('original_data_id'),
'The original_data_id field was already added in the member_application table!'
);
$schema->getTable('member_application')->addColumn('original_data_id', Types::STRING, [
'length' => 255,
'notnull' => false,
'default' => 'null',
]);
$schema->getTable('member_application')->addIndex(
['original_data_id'],
'uniq_member_application_original_data_id'
);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('member_application')->hasColumn('original_data_id'),
'The original_data_id field was already removed from the member_application table!'
);
$schema->getTable('member_application')->dropColumn('original_data_id');
$schema->getTable('member_application')->dropIndex(
'uniq_member_application_original_data_id'
);
}
}