<?php

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

class CreateWebsiteObjectsSearchTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('website_objects_search', function(Blueprint $table)
		{
			$table->integer('website_object_id')->unsigned();
			$table->string('language_id', 10)->index('idx_website_objects_search_language');
			$table->text('primary_search')->index('Index_4');
			$table->text('secondary_search')->index('Index_5');
			$table->integer('image_id')->unsigned()->nullable();
			$table->string('title');
			$table->text('content', 65535)->nullable();
			$table->string('content_type', 100);
			$table->string('group_label', 100);
			$table->string('uri')->nullable();
			$table->increments('id');
			$table->unique(['website_object_id','language_id'], 'Index_7');
			$table->index(['primary_search','secondary_search'], 'idx_website_objects_search_ft');
		});
	}


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

}
