Files
FlightsAPI/database/migrations/2026_04_01_062821_add_v_australia.php
T
2026-04-01 16:34:01 +10:00

45 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
//Update Virgin Australia's ICAO Code
DB::table('airlines')
->where('IATA_code', 'VA')
->where('internal_name', 'virgin-australia')
->update(['ICAO_code' => 'VOZ']);
DB::table('airlines')->insert([
'IATA_code' => 'VA',
'ICAO_code' => 'VAU',
'name' => 'V Australia',
'internal_name' => 'v-australia',
'country_code' => 'AU',
'country_name' => 'Australia',
'active' => false,
'logo' => 'VA_2.png',
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
DB::table('airlines')
->where('IATA_code', 'VA')
->where('internal_name', 'virgin-australia')
->update(['ICAO_code' => 'VAU']);
DB::table('airlines')->where('internal_name', 'v-australia')->delete();
}
};