- 134-tool registry with programmatic SEO (unique titles/H1/descriptions, JSON-LD graphs, sitemap index, canonical 301 enforcement via required filter) - DB-backed job queue (SKIP LOCKED) with drivers: Ffmpeg, Images (GD), Pdf (qpdf/gs/poppler), Youtube (thumbnails), Qr (server-side PNG) - Security: SSRF guard, MIME validation, rate limits, API-key auth, bcrypt admin login, security headers - Admin panel: dashboard, tools/categories/guides CRUD, SEO audit, analytics, job inspector with retry, system health, feature flags - Docker deployment (nginx + web/api FPM pools + scalable workers), PHPUnit suite (19 tests / 1139 assertions), PWA manifest + service worker
42 lines
1.8 KiB
PHP
42 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
final class CreateGuides extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
$this->forge->addField([
|
|
'id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
|
|
'slug' => ['type' => 'VARCHAR', 'constraint' => 160, 'unique' => true],
|
|
'title' => ['type' => 'VARCHAR', 'constraint' => 190],
|
|
'excerpt' => ['type' => 'VARCHAR', 'constraint' => 320],
|
|
'body_md' => ['type' => 'LONGTEXT', 'null' => true],
|
|
// tools this guide should interlink with (auto "Related tools" block)
|
|
'tool_slugs' => ['type' => 'JSON', 'null' => true],
|
|
'category_id' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
|
'seo_title' => ['type' => 'VARCHAR', 'constraint' => 190, 'null' => true],
|
|
'seo_description' => ['type' => 'VARCHAR', 'constraint' => 320, 'null' => true],
|
|
'reading_minutes' => ['type' => 'INT', 'unsigned' => true, 'default' => 4],
|
|
'views' => ['type' => 'BIGINT', 'unsigned' => true, 'default' => 0],
|
|
'status' => ['type' => 'ENUM', 'constraint' => ['published', 'draft'], 'default' => 'draft'],
|
|
'published_at' => ['type' => 'DATETIME', 'null' => true],
|
|
'created_at' => ['type' => 'DATETIME', 'null' => true],
|
|
'updated_at' => ['type' => 'DATETIME', 'null' => true],
|
|
]);
|
|
$this->forge->addPrimaryKey('id');
|
|
$this->forge->addKey('status');
|
|
$this->forge->addKey('published_at');
|
|
$this->forge->createTable('guides', true);
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->forge->dropTable('guides', true);
|
|
}
|
|
}
|