Add helpdesk import progress, category model, article metadata columns, and ticket pagination controls

This commit is contained in:
SitiWeb
2026-04-29 13:21:52 +02:00
parent 3c4572bb12
commit 01aa115a49
7 changed files with 234 additions and 33 deletions

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::create('categories', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('external_id')->nullable()->unique();
$table->foreignId('parent_id')->nullable()->constrained('categories')->nullOnDelete();
$table->string('name');
$table->string('slug')->nullable();
$table->timestamps();
$table->index(['parent_id', 'name']);
});
Schema::table('articles', function (Blueprint $table) {
$table->string('source')->nullable()->after('content');
$table->string('source_url')->nullable()->after('source');
$table->unsignedBigInteger('source_article_id')->nullable()->after('source_url');
$table->foreignId('category_id')->nullable()->after('source_article_id')->constrained('categories')->nullOnDelete();
$table->foreignId('subcategory_id')->nullable()->after('category_id')->constrained('categories')->nullOnDelete();
$table->index('source_article_id');
});
}
public function down(): void
{
Schema::table('articles', function (Blueprint $table) {
$table->dropConstrainedForeignId('subcategory_id');
$table->dropConstrainedForeignId('category_id');
$table->dropColumn(['source', 'source_url', 'source_article_id']);
});
Schema::dropIfExists('categories');
}
};