<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddFlightBookingFieldsToContactMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('contact_messages', function (Blueprint $table) {
            $table->string('military_status')->nullable()->after('rank');
            $table->string('departure_city')->nullable()->after('military_status');
            $table->string('destination_city')->nullable()->after('departure_city');
            $table->date('departure_date')->nullable()->after('destination_city');
            $table->date('return_date')->nullable()->after('departure_date');
            $table->string('passengers')->nullable()->after('return_date');
            $table->string('trip_type')->nullable()->after('passengers');
            $table->string('payment_preference')->nullable()->after('trip_type');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('contact_messages', function (Blueprint $table) {
            $table->dropColumn([
                'military_status',
                'departure_city',
                'destination_city',
                'departure_date',
                'return_date',
                'passengers',
                'trip_type',
                'payment_preference'
            ]);
        });
    }
}
