Files
FlightsAPI/database/migrations/2026_04_02_030531_add_tsaradia.php
T
2026-04-02 13:19:25 +10:00

51 lines
1.3 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
{
DB::table('airlines')->insert([
'IATA_code' => 'TZ',
'ICAO_code' => 'TDS',
'name' => 'Tsaradia',
'internal_name' => 'tsaradia',
'country_code' => 'MG',
'country_name' => 'Madagascar',
'active' => false,
'logo' => 'TZ.png',
]);
DB::table('airlines')
->where('IATA_code', 'TZ')
->where('internal_name', 'scoot-private')
->update([
'active' => false,
'logo' => 'TR.png',
'name' => 'Scoot'
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
DB::table('airlines')->where('internal_name', 'tsaradia')->delete();
DB::table('airlines')
->where('IATA_code', 'TZ')
->where('internal_name', 'scoot-private')
->update([
'active' => true,
'logo' => 'TZ.png',
'name' => 'Scoot Private Limited'
]);
}
};