<?php

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

class AddProceduresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tramites',function(Blueprint $table){
            $table->increments('id');
            $table->string('nombre');
            $table->char('prefijo',3) -> unique();
            $table->boolean('payOrder')->default(true);
            $table -> integer('promotoria_id') -> unsigned();
            $table->foreign('promotoria_id')->references('id')->on('promotorias')
                ->onUpdate('cascade')->onDelete('cascade');
            $table->softDeletes();
            $table->timestamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('tramites');
    }
}
