Add helpdesk import progress, category model, article metadata columns, and ticket pagination controls
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user