Skip to content

Commit d97bc2d

Browse files
committed
Create necessary index
1 parent fb03b61 commit d97bc2d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/QueryTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use BadMethodCallException;
88
use DateTimeImmutable;
9+
use Illuminate\Support\Facades\Schema;
910
use LogicException;
1011
use MongoDB\BSON\Regex;
1112
use MongoDB\Laravel\Eloquent\Builder;
@@ -44,7 +45,9 @@ public function setUp(): void
4445

4546
public function tearDown(): void
4647
{
47-
User::truncate();
48+
Schema::table('users', function ($table) {
49+
$table->drop();
50+
});
4851
Scoped::truncate();
4952
Birthday::truncate();
5053

@@ -576,6 +579,9 @@ public function testPaginateDistinct(): void
576579

577580
public function testPaginateNear(): void
578581
{
582+
Schema::table('users', function ($table) {
583+
$table->geospatial('position', '2dsphere');
584+
});
579585
User::insert([
580586
['name' => 'Store A', 'position' => [9.224596977233887, 52.03082275390625]],
581587
['name' => 'Store B', 'position' => [9.224596977233887, 52.03082275390625]],

0 commit comments

Comments
 (0)