<?php

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

class CreateIqSitesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('iq_sites', function (Blueprint $table) {
            $table->increments('id');

            $table->string('slug')->unique()->index();

            $table->string('headline')->nullable();
            $table->text('copy')->nullable();

            $table->string('products')->nullable();
            $table->string('set_products')->nullable();

            $table->unsignedInteger('iq_image_id')->nullable()->index();

            $table->foreign('iq_image_id')
                ->references('id')
                ->on('iq_images');



            $table->timestamps();

        });
    }

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