Skip to content

Commit edbd9d8

Browse files
committed
Merge pull request laravelio#215 from simik-ru/master
Add indexes to tagged_items table
2 parents 8a242d7 + d3ef16a commit edbd9d8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class AddIndexesToTaggedItems extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::table('tagged_items', function (Blueprint $table) {
16+
$table->index('thread_id');
17+
$table->index('tag_id');
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('tagged_items', function (Blueprint $table) {
29+
$table->dropIndex(['thread_id']);
30+
$table->dropIndex(['tag_id']);
31+
});
32+
}
33+
}

0 commit comments

Comments
 (0)