1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Added search name weighting. Closes #27.

This commit is contained in:
Dan Brown
2015-12-05 15:11:48 +00:00
parent c32d70abc4
commit 46c905df8a
2 changed files with 46 additions and 9 deletions

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FulltextWeighting extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE pages ADD FULLTEXT name_search(name)');
DB::statement('ALTER TABLE books ADD FULLTEXT name_search(name)');
DB::statement('ALTER TABLE chapters ADD FULLTEXT name_search(name)');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('pages', function(Blueprint $table) {
$table->dropIndex('name_search');
});
Schema::table('books', function(Blueprint $table) {
$table->dropIndex('name_search');
});
Schema::table('chapters', function(Blueprint $table) {
$table->dropIndex('name_search');
});
}
}