Add airports
This commit is contained in:
@@ -30,6 +30,14 @@ DB_DATABASE=flightsapi
|
|||||||
DB_USERNAME=root
|
DB_USERNAME=root
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
|
|
||||||
|
PRODUCTION_DB_CONNECTION=
|
||||||
|
PRODUCTION_DB_HOST=
|
||||||
|
PRODUCTION_DB_PORT=
|
||||||
|
PRODUCTION_DB_DATABASE=
|
||||||
|
PRODUCTION_DB_USERNAME=
|
||||||
|
PRODUCTION_DB_PASSWORD=
|
||||||
|
|
||||||
|
|
||||||
SESSION_DRIVER=database
|
SESSION_DRIVER=database
|
||||||
SESSION_LIFETIME=120
|
SESSION_LIFETIME=120
|
||||||
SESSION_ENCRYPT=false
|
SESSION_ENCRYPT=false
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user