Skip to content

Commit 59abae1

Browse files
authored
⚡️ Improve speed in location based station lookup (#3255)
1 parent 8eb399e commit 59abae1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up(): void {
10+
Schema::table('train_stations', function(Blueprint $table) {
11+
$table->index(['latitude', 'longitude']);
12+
});
13+
}
14+
15+
public function down(): void {
16+
Schema::table('train_stations', function(Blueprint $table) {
17+
$table->dropIndex(['latitude', 'longitude']);
18+
});
19+
}
20+
};

0 commit comments

Comments
 (0)