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