<?php

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

class CreateEventocalendarioTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gtv_eventocalendario', function (Blueprint $table) {
            $table->engine = "InnoDB";
            $table->charset = 'utf8';
            $table->collation = 'utf8_unicode_ci';
            $table->increments('id_evecal')->unsigned();
            $table->date('finicio_evecal');
            $table->date('ftermino_evecal');
            $table->integer('status_evecal');
            $table->integer('id_act')->unsigned();
            $table->foreign('id_act')->references('id_act')->on('gtv_actividad')->onDelete('restrict')->onUpdate('cascade');
            $table->integer('id_cal')->unsigned();
            $table->foreign('id_cal')->references('id_cal')->on('gtv_calendario')->onDelete('restrict')->onUpdate('cascade');
            $table->timestamps();
        });
    }

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