29 lines
753 B
PHP
29 lines
753 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20251224193000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add indexes for forum parent ordering and type filters.';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('CREATE INDEX idx_forum_parent_position ON forum (parent_id, position)');
|
|
$this->addSql('CREATE INDEX idx_forum_type ON forum (type)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP INDEX idx_forum_parent_position ON forum');
|
|
$this->addSql('DROP INDEX idx_forum_type ON forum');
|
|
}
|
|
}
|