Skip to content

Commit e4fdc5b

Browse files
committed
Require the name of the index to drop
1 parent b97023f commit e4fdc5b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Schema/Blueprint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public function vectorSearchIndex(array $definition, string $name = 'default'):
342342
/**
343343
* Drop an Atlas Search or Vector Search index
344344
*/
345-
public function dropSearchIndex(string $name = 'default'): static
345+
public function dropSearchIndex(string $name): static
346346
{
347347
$this->collection->dropSearchIndex($name);
348348

tests/SchemaTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,8 @@ public function testSearchIndex(): void
540540
self::assertFalse($index['latestDefinition']['mappings']['dynamic']);
541541
self::assertSame('lucene.whitespace', $index['latestDefinition']['mappings']['fields']['foo']['analyzer']);
542542

543-
// Drop the index using default name
544543
Schema::table('newcollection', function (Blueprint $collection) {
545-
$collection->dropSearchIndex();
544+
$collection->dropSearchIndex('default');
546545
});
547546

548547
$index = $this->getSearchIndex('newcollection', 'default');

0 commit comments

Comments
 (0)