<?php

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

class AddColumnsIntoUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('emg_tel')->nullable()->after('phone_number');
            $table->string('mobile_tel')->nullable()->after('phone_number');
            $table->date('date_of_birth')->nullable()->after('gender');
            $table->string('reminder_answer')->nullable()->after('slug');
            $table->smallInteger('reminder_question')->nullable()->after('slug');
            $table->smallInteger('email_format')->nullable()->after('email_verified_at');
            $table->smallInteger('email_subscribe')->nullable()->after('email_verified_at');
            $table->smallInteger('is_temp')->default(0)->after('login_url');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('emg_tel');
            $table->dropColumn('mobile_tel');
            $table->dropColumn('date_of_birth');
            $table->dropColumn('reminder_answer');
            $table->dropColumn('reminder_question');
            $table->dropColumn('email_format');
            $table->dropColumn('email_subscribe');
            $table->dropColumn('is_temp');
        });
    }
}
