<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230524094906 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add is_removed field for the health_mutual table';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('health_mutual')->hasColumn('is_removed'),
'The is_removed field already set in the health_mutual table!'
);
$schema->getTable('health_mutual')
->addColumn('is_removed', 'boolean', ['notnull' => true, 'default' => false]);
}
public function down(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('health_mutual')->hasColumn('is_removed'),
'The is_removed is already removed from the health_mutual table!'
);
$schema->getTable('health_mutual')->dropColumn('is_removed');
}
}