<?php

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

class CreateLadoCorredoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ladocorredores', function (Blueprint $table) {
            $table->id();
            $table->enum('ladocorredor',['esquerdo','direito']);
            $table->foreignId('corredor_id');
            $table->softDeletes();
            $table->foreign('corredor_id')->references('id')->on('corredores')->onDelete('cascade');
            $table->timestamps();
        });
    }

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