started to add indexes and fixed N+1 issue

This commit is contained in:
Mark Gregory
2026-06-12 14:09:44 +01:00
parent 48371a281d
commit 05ff54ea76
8 changed files with 6 additions and 65 deletions
@@ -25,21 +25,4 @@ return new class extends Migration {
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::table('users', static function (Blueprint $table): void {
if (Schema::hasColumn('users', 'helpdesk_admin')) {
$table->dropColumn('helpdesk_admin');
}
if (Schema::hasColumn('users', 'helpdesk_agent')) {
$table->dropColumn('helpdesk_agent');
}
});
}
};
@@ -6,8 +6,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/** @return void */
return new class extends Migration
{
public function up(): void
{
Schema::create('helpdesk_statuses', static function (Blueprint $table): void {
@@ -70,14 +70,4 @@ return new class extends Migration {
$table->unique(['company_id', 'slug']);
});
}
/** @return void */
public function down(): void
{
Schema::dropIfExists('helpdesk_projects');
Schema::dropIfExists('helpdesk_teams');
Schema::dropIfExists('helpdesk_categories');
Schema::dropIfExists('helpdesk_priorities');
Schema::dropIfExists('helpdesk_statuses');
}
};
@@ -39,9 +39,4 @@ return new class extends Migration {
});
}
/** @return void */
public function down(): void
{
Schema::dropIfExists('helpdesk_tickets');
}
};
@@ -76,12 +76,4 @@ return new class extends Migration {
});
}
/** @return void */
public function down(): void
{
Schema::dropIfExists('helpdesk_workflow_logs');
Schema::dropIfExists('helpdesk_workflow_templates');
Schema::dropIfExists('helpdesk_git_commits');
Schema::dropIfExists('helpdesk_git_repositories');
}
};
@@ -38,10 +38,4 @@ return new class extends Migration {
});
}
/** @return void */
public function down(): void
{
Schema::dropIfExists('helpdesk_attachments');
Schema::dropIfExists('helpdesk_comments');
}
};
@@ -6,8 +6,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/** @return void */
return new class extends Migration
{
public function up(): void
{
Schema::create('helpdesk_category_user', static function (Blueprint $table): void {
@@ -18,10 +18,4 @@ return new class extends Migration {
$table->unique(['category_id', 'user_id']);
});
}
/** @return void */
public function down(): void
{
Schema::dropIfExists('helpdesk_category_user');
}
};
@@ -53,13 +53,4 @@ class HelpdeskPerformanceIndexes extends Migration
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}