<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20260226141803 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add composite index on teacher_import_batches (tenant_id, created_at DESC)';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('CREATE INDEX idx_teacher_import_batches_tenant_created ON teacher_import_batches (tenant_id, created_at DESC)');
        $this->addSql('DROP INDEX IF EXISTS idx_teacher_import_batches_tenant');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('CREATE INDEX idx_teacher_import_batches_tenant ON teacher_import_batches (tenant_id)');
        $this->addSql('DROP INDEX IF EXISTS idx_teacher_import_batches_tenant_created');
    }
}
