<?php

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

class CreateCorredoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('corredores', function (Blueprint $table) {
            $table->id();
            $table->integer('numerocorredor')->nullable();
            // $table->integer('quantidadedemodulos')->nullable();
            // $table->float('comprimentocorredor');
            $table->foreignId('configuracao_id');
            $table->foreignId('armazem_id');
            $table->foreignId('usuario_id');
            $table->softDeletes();
            $table->foreign('configuracao_id')->references('id')->on('configuracaocorredores');
            $table->foreign('usuario_id')->references('id')->on('users');
            $table->foreign('armazem_id')->references('id')->on('armazens');
            $table->timestamps();
        });
    }

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