<?php

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

class AddOtherHrColumnsToUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->boolean('is_on_payroll')->after('blocked')->default(0);
            $table->string('e_no')->after('is_on_payroll')->nullable();
            $table->string('bank_name')->after('e_no')->nullable();
            $table->string('bank_branch')->after('bank_name')->nullable();
            $table->string('bank_code')->after('bank_branch')->nullable();
            $table->string('acc_no')->after('bank_code')->nullable();
            $table->string('kra_pin')->after('acc_no')->nullable();
            $table->string('huduma_number')->after('kra_pin')->nullable();
            $table->string('id_no')->after('huduma_number')->nullable();
            $table->string('personal_email')->after('id_no')->nullable();
            $table->string('address')->after('personal_email')->nullable();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['is_on_payroll','e_no','bank_name','bank_branch','bank_code','acc_no','kra_pin','huduma_number','id_no','personal_email','address']);
        });
    }
}
