3 use Illuminate\Database\Schema\Blueprint;
4 use Illuminate\Database\Migrations\Migration;
6 class FulltextWeighting extends Migration
15 $prefix = DB::getTablePrefix();
16 DB::statement("ALTER TABLE {$prefix}pages ADD FULLTEXT name_search(name)");
17 DB::statement("ALTER TABLE {$prefix}books ADD FULLTEXT name_search(name)");
18 DB::statement("ALTER TABLE {$prefix}chapters ADD FULLTEXT name_search(name)");
22 * Reverse the migrations.
26 public function down()
28 Schema::table('pages', function(Blueprint $table) {
29 $table->dropIndex('name_search');
31 Schema::table('books', function(Blueprint $table) {
32 $table->dropIndex('name_search');
34 Schema::table('chapters', function(Blueprint $table) {
35 $table->dropIndex('name_search');