<?php

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

class CreateSolicitacaoDesligamentosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('solicitacao_desligamentos', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('id_nps');
            $table->unsignedBigInteger('id_user');
            $table->date('data');
            $table->time('inicio');
            $table->time('termino');
            $table->string('encarregado');
            $table->string('substituto');
            $table->timestamps();

            $table->foreign('id_nps')->references('id')->on('nps');
            $table->foreign('id_user')->references('id')->on('users');
        });
    }

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