<?php

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

class AddAdditionalInformationToCustomerAddressesTable extends Migration
{
    public function up()
    {
        Schema::table('customer_addresses', function (Blueprint $table) {
            if (!Schema::hasColumn('customer_addresses', 'additional_information')) {
                $table->text('additional_information')->nullable()->after('address');
            }
        });
    }

    public function down()
    {
        Schema::table('customer_addresses', function (Blueprint $table) {
            if (Schema::hasColumn('customer_addresses', 'additional_information')) {
                $table->dropColumn('additional_information');
            }
        });
    }
}
