Merge pull request #14770 from uberbrady/add_locations_parent_index

Add index to 'parent_id' for users with large number of locations
This commit is contained in:
snipe 2024-05-27 15:43:49 +01:00 committed by GitHub
commit 172d24fd3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddParentIdIndexToLocations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function (Blueprint $table) {
$table->index('parent_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function (Blueprint $table) {
//
$table->dropIndex('locations_parent_id_index');
});
}
}