added support for legacy tickets
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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('helpdesk_legacy_categories', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('legacy_id')->unique();
|
||||
$table->string('name');
|
||||
$table->string('color', 32)->nullable();
|
||||
$table->unsignedInteger('ticket_count')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('helpdesk_legacy_tickets', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('legacy_id')->unique();
|
||||
$table->string('reference')->nullable()->index();
|
||||
$table->string('subject');
|
||||
$table->longText('content')->nullable();
|
||||
$table->longText('html_content')->nullable();
|
||||
$table->unsignedBigInteger('legacy_category_id')->nullable()->index();
|
||||
$table->string('category_name')->nullable();
|
||||
$table->string('status_name')->nullable();
|
||||
$table->string('priority_name')->nullable();
|
||||
$table->string('requester_name')->nullable();
|
||||
$table->string('agent_name')->nullable();
|
||||
$table->string('project_name')->nullable();
|
||||
$table->timestamp('legacy_created_at')->nullable()->index();
|
||||
$table->timestamp('legacy_updated_at')->nullable();
|
||||
$table->timestamp('completed_at')->nullable();
|
||||
$table->timestamp('archived_at')->nullable();
|
||||
$table->json('legacy_data')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('helpdesk_legacy_comments', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('legacy_id')->unique();
|
||||
$table->unsignedBigInteger('legacy_ticket_id')->index();
|
||||
$table->string('author_name')->nullable();
|
||||
$table->longText('content')->nullable();
|
||||
$table->longText('html_content')->nullable();
|
||||
$table->timestamp('legacy_created_at')->nullable();
|
||||
$table->timestamp('legacy_updated_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('helpdesk_legacy_comments');
|
||||
Schema::dropIfExists('helpdesk_legacy_tickets');
|
||||
Schema::dropIfExists('helpdesk_legacy_categories');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user