<?php

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

class Update1559036079ResidentialComplexesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('residential_complexes', function (Blueprint $table) {
            if(Schema::hasColumn('residential_complexes', 'meta_title')) {
                $table->dropColumn('meta_title');
            }
            if(Schema::hasColumn('residential_complexes', 'meta_keywords')) {
                $table->dropColumn('meta_keywords');
            }
            if(Schema::hasColumn('residential_complexes', 'meta_description')) {
                $table->dropColumn('meta_description');
            }
            if(Schema::hasColumn('residential_complexes', 'seo_text')) {
                $table->dropColumn('seo_text');
            }
            
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('residential_complexes', function (Blueprint $table) {
                        $table->string('meta_title')->nullable();
                $table->string('meta_keywords')->nullable();
                $table->string('meta_description')->nullable();
                $table->string('seo_text')->nullable();
                
        });

    }
}
