<?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 Version20260702115209 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Create payment_logs audit table';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('CREATE TABLE payment_logs (id INT AUTO_INCREMENT NOT NULL, payment_id INT NOT NULL, action VARCHAR(20) NOT NULL, gateway VARCHAR(20) NOT NULL, result VARCHAR(20) NOT NULL, authority VARCHAR(255) DEFAULT NULL, client_ip VARCHAR(45) DEFAULT NULL, payload JSON DEFAULT NULL, created_at INT NOT NULL, INDEX idx_payment_logs_payment (payment_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('DROP TABLE payment_logs');
    }
}
