Skip to content

Commit c5542ce

Browse files
authored
Support for adding full-text index using migration. (#5701)
1 parent b6762bd commit c5542ce

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/Schema/Grammars/PostgresGrammar.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,9 @@ public function compileIndex(Blueprint $blueprint, Fluent $command)
182182
/**
183183
* Compile a fulltext index key command.
184184
*
185-
* @return string
186185
* @throws RuntimeException
187186
*/
188-
public function compileFulltext(Blueprint $blueprint, Fluent $command)
187+
public function compileFullText(Blueprint $blueprint, Fluent $command): string
189188
{
190189
$language = $command->language ?: 'english';
191190

@@ -369,10 +368,8 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command)
369368

370369
/**
371370
* Compile a drop fulltext index command.
372-
*
373-
* @return string
374371
*/
375-
public function compileDropFulltext(Blueprint $blueprint, Fluent $command)
372+
public function compileDropFullText(Blueprint $blueprint, Fluent $command): string
376373
{
377374
return $this->compileDropIndex($blueprint, $command);
378375
}

tests/Cases/DatabasePostgresSchemaGrammarTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,20 @@ public function testAddingIndexWithAlgorithm()
274274
$this->assertSame('create index "baz" on "users" using hash ("foo", "bar")', $statements[0]);
275275
}
276276

277-
public function testAddingFulltextIndex()
277+
public function testAddingFullTextIndex()
278278
{
279279
$blueprint = new Blueprint('users');
280-
$blueprint->fulltext('body');
280+
$blueprint->fullText('body');
281281
$statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
282282

283283
$this->assertCount(1, $statements);
284284
$this->assertSame('create index "users_body_fulltext" on "users" using gin (to_tsvector(\'english\', "body"))', $statements[0]);
285285
}
286286

287-
public function testAddingFulltextIndexWithLanguage()
287+
public function testAddingFullTextIndexWithLanguage()
288288
{
289289
$blueprint = new Blueprint('users');
290-
$blueprint->fulltext('body')->language('spanish');
290+
$blueprint->fullText('body')->language('spanish');
291291
$statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
292292

293293
$this->assertCount(1, $statements);

0 commit comments

Comments
 (0)