<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

final class Version20260624120000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add forensic context columns (ip, user agent, device label, device id) to audit_logs';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE audit_logs ADD ip_address VARCHAR(45) DEFAULT NULL');
        $this->addSql('ALTER TABLE audit_logs ADD user_agent TEXT DEFAULT NULL');
        $this->addSql('ALTER TABLE audit_logs ADD device_label VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE audit_logs ADD device_id VARCHAR(64) DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE audit_logs DROP COLUMN ip_address');
        $this->addSql('ALTER TABLE audit_logs DROP COLUMN user_agent');
        $this->addSql('ALTER TABLE audit_logs DROP COLUMN device_label');
        $this->addSql('ALTER TABLE audit_logs DROP COLUMN device_id');
    }
}
