Add airports

This commit is contained in:
2026-04-03 14:28:17 +10:00
parent 8ec4e92541
commit d7140f1554
2 changed files with 42 additions and 0 deletions
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
private string $icaoCode = 'YSWS';
public function up(): void
{
$region = DB::table('regions')->where('code', 'AU-NSW')->firstOrFail();
DB::table('airports')->insert([
'type' => 'large_airport', // large_airport, medium_airport, small_airport, heliport, seaplane_base, balloonport, closed
'name' => 'Western Sydney International Airport',
'latitude_deg' => -33.883461,
'longitude_deg'=> 150.712981,
'elevation_ft' => 262,
'region_id' => $region->id,
'municipality' => 'Sydney',
'icao_code' => $this->icaoCode,
'iata_code' => 'WSI',
'local_code' => null,
'created_at' => now(),
'updated_at' => now(),
]);
}
public function down(): void
{
DB::table('airports')->where('icao_code', $this->icaoCode)->delete();
}
};