<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20251208220000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add internal_name field to mycmcm_request_category table';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('mycmcm_request_category');
$this->skipIf(
$table->hasColumn('internal_name'),
'The internal_name column already exists in the mycmcm_request_category table'
);
$table->addColumn('internal_name', Types::STRING)
->setLength(100)
->setNotnull(false);
}
public function down(Schema $schema): void
{
$table = $schema->getTable('mycmcm_request_category');
$this->skipIf(
!$table->hasColumn('internal_name'),
'The internal_name column does not exist in the mycmcm_request_category table'
);
$table->dropColumn('internal_name');
}
}