<?php

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

class CreateCelulasTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('celulas', function (Blueprint $table) {
            $table->id();
            $table->integer('nivel');
            $table->unsignedBigInteger('modulo_id');
            $table->float('alturam',8,2);
            $table->float('alturacm',8,2);
            $table->float('profundidadem',8,2);
            $table->float('profundidadecm',8,2);
            $table->foreignId('tipocaixasugestao_id')->nullable();
            $table->softDeletes();
            $table->timestamps();
            $table->foreign('modulo_id')->references('id')->on('modulos');
        });
    }

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