Improved deferred bindings query performance (#3014)

Credit to @MatheusNaldi. Fixes #2877
This commit is contained in:
Matheus Naldi 2017-08-07 14:54:33 -03:00 committed by Luke Towers
parent 969eaccf8b
commit f8ceeb7b52
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DbDeferredBindingsAddIndexSession extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('deferred_bindings', function (Blueprint $table) {
$table->index('session_key');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('deferred_bindings', function (Blueprint $table) {
$table->dropIndex(['session_key']);
});
}
}