<?php
/**
 * Table Migration
**/

namespace Modules\NsGastro\Migrations;

use App\Classes\Schema;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class UpdateCreateTimeStampOnAreasTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return  void
     */
    public function up()
    {
        if ( Schema::hasTable( 'nexopos_gastro_areas' ) ) {
            Schema::table('nexopos_gastro_areas', function (Blueprint $table) {
                if (! Schema::hasColumns('nexopos_gastro_areas', ['created_at', 'updated_at'])) {
                    $table->timestamps();
                }
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return  void
     */
    public function down()
    {
        // drop tables here
    }
}
