<?php

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

class CreateArticlesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('articles', function($table)
		{
	        $table->increments('id');
	        $table->string('title',250);
	        $table->mediumText('intro_text');
	        $table->mediumText('full_text');
	        $table->tinyInteger('state');

	        $table->integer('created_by')->unsigned();
	        $table->foreign('created_by')
				      ->references('id')->on('users');
			$table->string('created_by_alias');

			$table->integer('category_id')->unsigned();
			$table->date('created');
			$table->date('publish_up');
	        $table->date('publish_down');

	        $table->text('metakey');
	        $table->text('metadesc');


	        $table->enum('language', ['all', 'es', 'en']);
	        $table->text('gallery_items');
	
	        $table->text('intro_image');
	        $table->text('large_image');

	        $table->timestamps();
		});
	}

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

}
