<?php

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

class AddRecnoToRequestTellerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $columns = ['recno'];

        $columns_not_exist = array_filter($columns, function ($column) {
            return !Schema::connection('mysql7')->hasColumn('requestteller', $column);
        });

        Schema::connection('mysql7')->table('requestteller', function (Blueprint $table) use ($columns_not_exist) {
            array_walk($columns_not_exist, function ($column) use ($table) {
                $table->integer($column);
            });
        });
    }
}
