27 lines
668 B
PHP
27 lines
668 B
PHP
<?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();
|
|
}
|
|
}
|