<?php

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

class RemoveIsInvoiceGeneratedFromBookingLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('booking_logs')) {
            Schema::table('booking_logs', function (Blueprint $table) {
                $table->dropColumn('is_invoice_generated');
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (Schema::hasTable('booking_logs')) {
            Schema::table('booking_logs', function (Blueprint $table) {
                $table->boolean('is_invoice_generated')
                    ->default(false)
                    ->after('status');
            });
        }
    }
}
