<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20251119180000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add ranking column to dtb_product';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('dtb_product');
if (!$table->hasColumn('ranking')) {
$this->addSql('ALTER TABLE dtb_product ADD ranking INT DEFAULT NULL');
}
}
public function down(Schema $schema): void
{
$table = $schema->getTable('dtb_product');
if ($table->hasColumn('ranking')) {
$this->addSql('ALTER TABLE dtb_product DROP COLUMN ranking');
}
}
}