Add new indexes to improve some Location queries

This commit is contained in:
Brady Wetherington
2026-04-07 15:23:31 +01:00
parent 182e06173d
commit ddaa75a6dd
2 changed files with 56 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->index(['parent_id','deleted_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->dropIndex(['parent_id','deleted_at']);
});
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('accessories_checkout', function (Blueprint $table) {
$table->index(['assigned_to','assigned_type']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('accessories_checkout', function (Blueprint $table) {
$table->dropIndex(['assigned_to','assigned_type']);
});
}
};