<?php

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

class CreateArrumacoesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('arrumacoes', function (Blueprint $table) {
            $table->id();
            $table->integer('profundidade')->nullable();
            $table->integer('nivel')->nullable();
            $table->foreignId('caixa_id');
            $table->foreignId('fila_id');
            $table->foreignId('usuario_id');
            $table->foreign('usuario_id')->references('id')->on('users');
            $table->foreign('fila_id')->references('id')->on('filas');
            $table->foreign('caixa_id')->references('id')->on('caixas');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('arrumacoes', function(Blueprint $table)
        {
            $table->dropSoftDeletes();
        });
        Schema::dropIfExists('arrumacoes');
    }
}
