Squashed commit of the following:

commit e29339b2084e4531164a2904869460c4928a6d03
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 6 20:35:29 2016 +0000

    Remove algolia credit

commit 2ee543b8d37bcf008a8e82a72202420a48f2b38e
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 6 20:34:02 2016 +0000

    Updated and added dependencies

commit 5aba9dda8a8a5c5e9837f409a3991d2d4f4bd8c2
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 6 20:29:57 2016 +0000

    Add relavent model options for postgres searching with scout

commit ace894529d12773997336c4acbfe77f157d00eb7
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 6 20:28:47 2016 +0000

    Add pgsql scout option

commit 7c794fd35af0ef53d005a8d68d3b99316312536d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 6 20:28:06 2016 +0000

    Add the PostgresEngine service provider

commit 19ba7c2e7d103302209151244ec6a11b3fab3e13
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Tue Dec 6 20:27:09 2016 +0000

    Add the searchable column and index to the notes table
This commit is contained in:
Jonny Barnes 2016-12-06 20:38:52 +00:00
parent bfce76b94e
commit bd92f1d6c8
8 changed files with 121 additions and 75 deletions

View file

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddSearchToNotes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('notes', function (Blueprint $table) {
DB::statement('ALTER TABLE notes ADD searchable tsvector NULL');
DB::statement('CREATE INDEX notes_searchable_index ON notes USING GIN (searchable)');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::statement('DROP INDEX IF EXISTS notes_searchable_index');
DB::statement('ALTER TABLE notes DROP searchable');
}
}