<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export (1.4.1)
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateTravelAgendaTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('travel_agenda', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 255);
            $table->bigInteger('travelcountry_id')->nullable();
            $table->boolean('active')->default(true);


            $table->index('travelcountry_id', 'travelcountry_id_idx');

            $table->foreign('travelcountry_id', 'travel_agenda_travelcountry_id_travel_country_id')->references('id')->on('travel_country'
            )->onDelete('RESTRICT')->onUpdate('RESTRICT');

        });



    }

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