<?php

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

class DeleteRepresentativeFieldsFromAddressesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('addresses', function (Blueprint $table) {
            $table->dropColumn('title_representative');
            $table->dropColumn('initials_representative');
            $table->dropColumn('first_name_representative');
            $table->dropColumn('middle_name_representative');
            $table->dropColumn('last_name_representative');
            $table->dropColumn('email_representative');            
            $table->dropColumn('job_title_representative');   
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('addresses', function (Blueprint $table) {
            $table->string('title_representative')->after('country')->nullable();
            $table->string('initials_representative')->after('title_representative')->nullable();
            $table->string('first_name_representative')->after('initials_representative')->nullable();
            $table->string('middle_name_representative')->after('first_name_representative')->nullable();
            $table->string('last_name_representative')->after('middle_name_representative')->nullable();
            $table->string('email_representative')->after('last_name_representative')->nullable();
            $table->string('job_title_representative')->after('email_representative')->nullable();
        });
    }
}
