<?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'
            ]);
    }
};
