<?php

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

class CreateConfiguracaocorredoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('configuracaocorredores', function (Blueprint $table) {
            $table->id();
            $table->string('nomeconfiguracao');
            $table->integer('numeroandares')->nullable();
            $table->integer('numeromodulo')->nullable();
            // $table->float('larguracorredor',8,2)->nullable();
            // $table->float('comprimentocorredor',8,2)->nullable();
            // $table->enum('esquerda',['sim','nao'])->nullable();
            // $table->enum('direita',['sim','nao'])->nullable();
            $table->foreignId('base_id');
            $table->foreignId('usuario_id');
            $table->softDeletes();
            $table->foreign('usuario_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
            $table->foreign('base_id')->references('id')->on('basesgestdocs')->onDelete('cascade')->onUpdate('cascade');
            $table->timestamps();
        });


    }

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