<?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 Version20260629161536 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Create app_log table for persisted application logs';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE TABLE app_log (id INT AUTO_INCREMENT NOT NULL, level VARCHAR(16) NOT NULL, message LONGTEXT NOT NULL, context LONGTEXT DEFAULT NULL, channel VARCHAR(32) DEFAULT NULL, path VARCHAR(255) DEFAULT NULL, created_at INT NOT NULL, INDEX idx_app_log_level (level, created_at), INDEX idx_app_log_created (created_at), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('DROP TABLE app_log');
    }
}
