<?php

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

class CreateDocumentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('documents', function (Blueprint $table) {
            $table->id();
            $table->string('names');
            $table->string('first_lastname');
            $table->string('second_lastname');
            $table->string('dni');
            $table->date('date_create');
            $table->time('time_create', $precision = 0);
            $table->string('result_reniec');
            $table->string('urlimage');
            $table->unsignedBigInteger('fk_user')->unsigned();
            $table->foreign('fk_user')->references('id_user')->on('usuarios');
            $table->boolean('valid');
            $table->timestamps();
        });
    }

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