<?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 Version20260309165048 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE chapter ADD pages_directory VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE chapter ADD page_count INT DEFAULT 0 NOT NULL');
        $this->addSql('DROP INDEX IF EXISTS idx_available_at');
        $this->addSql('DROP INDEX IF EXISTS idx_delivered_at');
        $this->addSql('DROP INDEX IF EXISTS idx_queue_available');
        $this->addSql('DROP INDEX IF EXISTS idx_queue_name');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE SCHEMA public');
        $this->addSql('CREATE INDEX idx_available_at ON messenger_messages (available_at)');
        $this->addSql('CREATE INDEX idx_delivered_at ON messenger_messages (delivered_at)');
        $this->addSql('CREATE INDEX idx_queue_available ON messenger_messages (queue_name, available_at)');
        $this->addSql('CREATE INDEX idx_queue_name ON messenger_messages (queue_name)');
        $this->addSql('ALTER TABLE chapter DROP pages_directory');
        $this->addSql('ALTER TABLE chapter DROP page_count');
    }
}
