ogcore/migrations/Version20260414120000.php

35 lines
815 B
PHP

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