<?php

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

class AddColumnsIntoContacts extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('contacts', function (Blueprint $table) {
            $table->smallInteger('is_other_address')->default(0)->after('building_name');
            $table->integer('user_id')->nullable()->after('building_name');
            $table->string('other_address3')->nullable()->after('building_name');
            $table->string('other_address2')->nullable()->after('building_name');
            $table->string('other_address')->nullable()->after('building_name');
            $table->string('options')->nullable()->after('building_name');
            $table->double('product_total_amount', 15, 2)->nullable()->after('building_name');
            $table->double('product_shipping_cost', 15, 2)->nullable()->after('building_name');
            $table->double('product_tax', 15, 2)->nullable()->after('building_name');
            $table->double('product_standard_construction_fee', 15, 2)->nullable()->after('building_name');
            $table->double('product_price', 15, 2)->nullable()->after('building_name');
            $table->double('product_sale_cost', 15, 2)->nullable()->after('building_name');
            $table->integer('product_discount')->nullable()->after('building_name');
            $table->double('product_price_to', 15, 2)->nullable()->after('building_name');
            $table->double('product_price_from', 15, 2)->nullable()->after('building_name');
            $table->double('product_regular_price_to', 15, 2)->nullable()->after('building_name');
            $table->double('product_regular_price_from', 15, 2)->nullable()->after('building_name');
            $table->string('product_image')->nullable()->after('building_name');
            $table->string('product_name')->nullable()->after('building_name');
            $table->string('product_code')->nullable()->after('building_name');
            $table->integer('product_id')->nullable()->after('building_name');
            $table->string('schedule_request_2_time')->nullable()->after('building_name');
            $table->string('schedule_request_2_session')->nullable()->after('building_name');
            $table->string('schedule_request_2_date')->nullable()->after('building_name');
            $table->string('schedule_request_1_time')->nullable()->after('building_name');
            $table->string('schedule_request_1_session')->nullable()->after('building_name');
            $table->string('schedule_request_1_date')->nullable()->after('building_name');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('contacts', function (Blueprint $table) {
            $table->dropColumn('is_other_address');
            $table->dropColumn('user_id');
            $table->dropColumn('other_address3');
            $table->dropColumn('other_address2');
            $table->dropColumn('other_address');
            $table->dropColumn('options');
            $table->dropColumn('product_total_amount');
            $table->dropColumn('product_shipping_cost');
            $table->dropColumn('product_tax');
            $table->dropColumn('product_standard_construction_fee');
            $table->dropColumn('product_price');
            $table->dropColumn('product_sale_cost');
            $table->dropColumn('product_discount');
            $table->dropColumn('product_price_to');
            $table->dropColumn('product_price_from');
            $table->dropColumn('product_regular_price_to');
            $table->dropColumn('product_regular_price_from');
            $table->dropColumn('product_image');
            $table->dropColumn('product_name');
            $table->dropColumn('product_code');
            $table->dropColumn('product_id');
            $table->dropColumn('schedule_request_2_time');
            $table->dropColumn('schedule_request_2_session');
            $table->dropColumn('schedule_request_2_date');
            $table->dropColumn('schedule_request_1_time');
            $table->dropColumn('schedule_request_1_session');
            $table->dropColumn('schedule_request_1_date');
        });
    }
}
