<?php

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

class AddFieldsToContactsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('contacts', function (Blueprint $table) {
            $table->string('firstname_cp')->after('city_cp')->nullable();
            $table->string('middlename_cp')->after('firstname_cp')->nullable();
            $table->string('job_title_cp')->after('middlename_cp')->nullable();
            $table->string('email3_cp')->after('job_title_cp')->nullable();
            $table->string('mobile_cp')->after('email3_cp')->nullable();
            $table->string('house_number_cp')->after('mobile_cp')->nullable();

            $table->string('firstname_cc')->after('city_cc')->nullable();
            $table->string('middlename_cc')->after('firstname_cc')->nullable();
            $table->string('job_title_cc')->after('middlename_cc')->nullable();
            $table->string('email3_cc')->after('job_title_cc')->nullable();
            $table->string('mobile_cc')->after('email3_cc')->nullable();
            $table->string('house_number_cc')->after('mobile_cc')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('contacts', function (Blueprint $table) {
            $table->dropColumn('firstname_cp');
            $table->dropColumn('middlename_cp');
            $table->dropColumn('job_title_cp');
            $table->dropColumn('email3_cp');
            $table->dropColumn('mobile_cp');
            $table->dropColumn('house_number_cp');

            $table->dropColumn('firstname_cc');
            $table->dropColumn('middlename_cc');
            $table->dropColumn('job_title_cc');
            $table->dropColumn('email3_cc');
            $table->dropColumn('mobile_cc');
            $table->dropColumn('house_number_cc');
        });
    }
}
