<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20230517092001 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add health_mutual_status_updated_at field for the member_application table';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('member_application')->hasColumn('health_mutual_status_updated_at'),
'The health_mutual_status_updated_at field already set in the member_application table!'
);
$schema->getTable('member_application')
->addColumn('health_mutual_status_updated_at', Types::DATETIME_IMMUTABLE)
->setNotnull(false)
->setDefault(null);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('member_application')->hasColumn('health_mutual_status_updated_at'),
'The health_mutual_status_updated_at is already removed from the member_application table!'
);
$schema->getTable('member_application')->dropColumn('health_mutual_status_updated_at');
}
}