<?php

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

class CreateUsuariosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('usuarios', function (Blueprint $table) {
            $table->id('id_user');
            $table->string('name');
            $table->string('email');
            $table->string('dni');
            $table->string('password');
            $table->string('token');
            $table->boolean('mobil');
            $table->boolean('web');
            $table->unsignedBigInteger('fk_rol')->unsigned();
            $table->foreign('fk_rol')->references('id_rol')->on('roles');
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
        });
    }

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