<?php

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

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('numero_empleado')->unique();
            $table->string('rfc')->unique();
            $table->string('role');
            $table->timestamp('fecha_ingreso');
            $table->integer('id_unidad_negocio')->nullable();
            $table->integer('id_politica_vacaciones')->nullable();
            $table->boolean('isBlocked');
            $table->ipAddress('last_ip')->nullable();
            $table->timestamp('fLogin')->nullable();
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
            $table->string('estatus', 1);
        });
    }

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