- Slim 4 + php-di контейнер с маршрутизацией - Docker Compose: app (PHP 8.3-FPM) + web (nginx) + db (MariaDB) - Phinx миграция: таблица users (uuid, username, password_hash) - Auth: login/logout с сессиями - Setup: создание первого пользователя - Dashboard с layout (Bootstrap 5.3) - CLI: bin/console, bin/run-scan-worker.php - Smoke test: scripts/check.sh - README.md, PLAN.md
22 lines
782 B
PHP
22 lines
782 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreateUsers extends AbstractMigration
|
|
{
|
|
public function change(): void
|
|
{
|
|
$table = $this->table('users', ['id' => false, 'primary_key' => ['id']]);
|
|
$table
|
|
->addColumn('id', 'uuid', ['null' => false])
|
|
->addColumn('username', 'string', ['limit' => 255, 'null' => false])
|
|
->addColumn('password_hash', 'string', ['limit' => 255, 'null' => false])
|
|
->addColumn('created_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP'])
|
|
->addColumn('updated_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP'])
|
|
->addIndex(['username'], ['unique' => true])
|
|
->create();
|
|
}
|
|
}
|