Add performance-improving indexes (#4278)

This commit is contained in:
Brady Wetherington 2017-10-20 17:17:11 -07:00 committed by snipe
parent 189574377a
commit 25d3d66880

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddLocationIndicesToAssets extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function (Blueprint $table) {
$table->index('rtd_location_id');
$table->index(['assigned_type','assigned_to']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function (Blueprint $table) {
//
$table->dropIndex(['rtd_location_id']);
$table->dropIndex(['assigned_type','assigned_to']);
});
}
}