<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20260628134241 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add missing indexes: appointments(status, expires_at) for the expiry scheduler, patient_sessions(created_at) for dashboard revenue ranges, users(status) for admin filters.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('CREATE INDEX idx_appointments_status_expires ON appointments (status, expires_at)');
        $this->addSql('CREATE INDEX idx_patient_sessions_created_at ON patient_sessions (created_at)');
        $this->addSql('CREATE INDEX idx_users_status ON users (status)');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('DROP INDEX idx_appointments_status_expires ON appointments');
        $this->addSql('DROP INDEX idx_patient_sessions_created_at ON patient_sessions');
        $this->addSql('DROP INDEX idx_users_status ON users');
    }
}
