Skip to content

Commit

Permalink
Add various indexes to the annotation_labels table
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Sep 23, 2016
1 parent 16fed7b commit 2a97dfb
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAnnotationLabelIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('annotation_labels', function (Blueprint $table) {
$table->index('annotation_id');
$table->index('label_id');
$table->index('user_id');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('annotation_labels', function (Blueprint $table) {
$table->dropIndex('annotation_labels_annotation_id_index');
$table->dropIndex('annotation_labels_label_id_index');
$table->dropIndex('annotation_labels_user_id_index');
});
}
}

0 comments on commit 2a97dfb

Please sign in to comment.