<?php

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

class CreateMainUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('main_users', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('prefix')->nullable();
            $table->string('first_name');
            $table->string('last_name');
            $table->string('email_address')->unique();
            $table->unsignedInteger('gender');
            $table->unsignedInteger('mode_of_employment');
            $table->unsignedInteger('role');
            $table->unsignedInteger('business_unit')->nullable();
            $table->unsignedInteger('department');
            $table->unsignedInteger('reporting_manager');
            $table->unsignedInteger('job_title')->nullable();
            $table->unsignedInteger('position')->nullable();
            $table->unsignedInteger('employment_status');
            $table->date('date_of_joining');
            $table->date('date_of_leaving')->nullable();
            $table->unsignedInteger('years_of_experience');
            $table->string('work_phone', 30)->nullable();
            $table->string('personal_phone', 30)->nullable();
            $table->string('kra_pin', 30)->nullable();
            $table->string('nssf_number', 30)->nullable();
            $table->string('nhif_number', 30)->nullable();
            $table->string('ifmis_number', 30)->nullable();
            $table->string('company_id')->nullable();
            $table->string('national_id')->nullable();
            $table->unsignedInteger('employee_type');
            $table->string('profile_image')->nullable();
            $table->string('password');
            $table->string('employee_id');
            $table->unsignedInteger('pwd')->default(0);
            $table->integer('created_by');
            $table->integer('modified_by');
            $table->integer('is_active')->default(1);
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('main_users');
    }
}
