<?php

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

class CreateSiteDetails extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
	Schema::create('site_details', function (Blueprint $table) {
		$table->integer('site_id');
		$table->string('key');
		$table->json('value');

		$table->foreign('site_id')->references('id')->on('ab_setup');
		$table->unique(['site_id','key']);
	});
    }

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