<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20221020125649 extends AbstractMigration
{
public function getDescription(): string
{
return 'Make dossier_id field nullable in member_application table';
}
public function up(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('member_application')->getColumn('dossier_id')->getNotnull(),
'The dossier_id field in the member_application table is already nullable!'
);
$schema->getTable('member_application')
->getColumn('dossier_id')->setNotnull(false);
}
public function down(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('member_application')->getColumn('dossier_id')->getNotnull(),
'The dossier_id field in the member_application table is already not nullable!'
);
$schema->getTable('member_application')
->getColumn('dossier_id')->setNotnull(true);
}
}