started to add indexes and fixed N+1 issue
This commit is contained in:
-17
@@ -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');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-12
@@ -6,8 +6,8 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration
|
||||||
/** @return void */
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('helpdesk_statuses', static function (Blueprint $table): void {
|
Schema::create('helpdesk_statuses', static function (Blueprint $table): void {
|
||||||
@@ -70,14 +70,4 @@ return new class extends Migration {
|
|||||||
$table->unique(['company_id', 'slug']);
|
$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');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
-5
@@ -39,9 +39,4 @@ return new class extends Migration {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return void */
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('helpdesk_tickets');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
-8
@@ -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');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
-6
@@ -38,10 +38,4 @@ return new class extends Migration {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return void */
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('helpdesk_attachments');
|
|
||||||
Schema::dropIfExists('helpdesk_comments');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-8
@@ -6,8 +6,8 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration
|
||||||
/** @return void */
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('helpdesk_category_user', static function (Blueprint $table): 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']);
|
$table->unique(['category_id', 'user_id']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return void */
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('helpdesk_category_user');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
-9
@@ -53,13 +53,4 @@ class HelpdeskPerformanceIndexes extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
|
|||||||
['name' => 'Stalled', 'slug' => 'stalled', 'color' => 'rose', 'sort_order' => 30, 'is_closed' => false],
|
['name' => 'Stalled', 'slug' => 'stalled', 'color' => 'rose', 'sort_order' => 30, 'is_closed' => false],
|
||||||
['name' => 'On-Hold', 'slug' => 'on-hold', 'color' => 'violet', 'sort_order' => 40, 'is_closed' => false],
|
['name' => 'On-Hold', 'slug' => 'on-hold', 'color' => 'violet', 'sort_order' => 40, 'is_closed' => false],
|
||||||
['name' => 'Closed', 'slug' => 'closed', 'color' => 'emerald', 'sort_order' => 90, 'is_closed' => true],
|
['name' => 'Closed', 'slug' => 'closed', 'color' => 'emerald', 'sort_order' => 90, 'is_closed' => true],
|
||||||
|
['name' => 'Testing', 'slug' => 'testing', 'color' => 'green', 'sort_order' => 30, 'is_closed' => false],
|
||||||
] as $row) {
|
] as $row) {
|
||||||
Status::query()->updateOrCreate(['slug' => $row['slug']], $row);
|
Status::query()->updateOrCreate(['slug' => $row['slug']], $row);
|
||||||
}
|
}
|
||||||
@@ -76,6 +77,7 @@ final class HelpdeskDatabaseSeeder extends Seeder
|
|||||||
['name' => 'Systems Deployment', 'color' => 'cyan', 'description' => 'Deployment, release, infrastructure and environment requests.'],
|
['name' => 'Systems Deployment', 'color' => 'cyan', 'description' => 'Deployment, release, infrastructure and environment requests.'],
|
||||||
['name' => 'Concepts', 'color' => 'purple', 'description' => 'Ideas, concepts, design discussion and future improvements.'],
|
['name' => 'Concepts', 'color' => 'purple', 'description' => 'Ideas, concepts, design discussion and future improvements.'],
|
||||||
['name' => 'Bug', 'color' => 'rose', 'description' => 'Defects, regressions and incorrect behaviour.'],
|
['name' => 'Bug', 'color' => 'rose', 'description' => 'Defects, regressions and incorrect behaviour.'],
|
||||||
|
['name' => 'Documentation', 'color' => 'red', 'description' => 'System Documents creation or update.'],
|
||||||
] as $row) {
|
] as $row) {
|
||||||
Category::query()->updateOrCreate(
|
Category::query()->updateOrCreate(
|
||||||
['company_id' => null, 'slug' => Str::slug($row['name'])],
|
['company_id' => null, 'slug' => Str::slug($row['name'])],
|
||||||
|
|||||||
Reference in New Issue
Block a user