<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20221006105830 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('member_application')->hasColumn('reminded_at'),
'The column reminded_at already exists'
);
$schema
->getTable('member_application')
->addColumn('reminded_at', Types::DATE_IMMUTABLE)
->setNotnull(false)
->setDefault(null)
;
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('member_application')->hasColumn('reminded_at'),
'The column reminded_at does not exists'
);
$schema
->getTable('member_application')
->dropColumn('reminded_at')
;
}
}