gruby refaktor otyły panie

This commit is contained in:
Sebastian Molenda
2026-05-13 22:43:29 +02:00
parent 0b23946116
commit 0e62b61188
2553 changed files with 0 additions and 532195 deletions
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateBlogVisits extends AbstractMigration
{
public function change(): void
{
// create table if it does not exist
$table = $this->table('blog_visits');
if (!$table->exists()) {
$table->addColumn('ip', 'string', ['null' => true, 'limit' => 255])
->addColumn('useragent', 'text', ['null' => true])
->addColumn('cnt', 'integer', ['default' => 0])
->addColumn('first_seen', 'integer', ['null' => true])
->addColumn('last_seen', 'integer', ['null' => true])
->addIndex(['ip', 'useragent'], ['unique' => true, 'name' => 'idx_ip_useragent'])
->create();
}
}
}