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