<?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('lasname');
$table->string('dni')->unique();
$table->string('phone');
$table->unsignedBigInteger('fk_idarea');
$table->foreign('fk_idarea')->references('id_area')->on('areas');
$table->boolean('sign');
$table->boolean('upload');
$table->string('pathsign');
$table->unsignedBigInteger('fk_rol');
$table->foreign('fk_rol')->references('id_rol')->on('rols');
$table->string('user')->unique();
$table->string('password');
$table->string('token');
        });
    }

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