<?php

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

class CreateTravelCountryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysql_stern')->create('travel_country', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('crm_id')->nullable()->index();
            $table->integer('feedback_page_id')->index();

            $table->string('name')->nullable();
            $table->text('html_information')->nullable();
            $table->text('entry_requirements')->nullable(); //need?

            $table->boolean('is_customer_country');
            $table->boolean('active_frontend')->default(false);
            $table->boolean('active_backend')->default(true);

            $table->timestamps();

            $table->foreign('feedback_page_id')
                ->references('id')
                ->on('page');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection('mysql_stern')->dropIfExists('travel_country');
    }
}
