<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;


// phpcs:ignore PSR1.Classes.ClassDeclaration.MissingNamespace
final class CreateAccessLogs extends AbstractMigration
{
    public function up()
    {
        $table = $this->table('access_logs');
        $table->addColumn('username', 'string')
            ->addColumn('password', 'string')
            ->addColumn('remote_ip', 'string')
            ->addColumn('user_agent', 'text')
            ->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP'])
            ->save();
    }

    public function down()
    {
        $this->table('access_logs')->drop()->save();
    }
}
