<?php

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

class CreateMediaItemsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('media_items', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('filename');
			$table->string('original_filename');
			$table->string('extension', 5);
			$table->string('related_type', 20)->nullable();
			$table->string('media_type', 20);
			$table->integer('backend_user_id')->unsigned()->index('FK_media_items_1');
			$table->timestamps();
			$table->string('title', 150)->nullable();
			$table->string('alt', 150)->nullable();
			$table->string('author', 150)->nullable();
			$table->integer('width')->unsigned()->nullable();
			$table->integer('height')->unsigned()->nullable();
		});
	}


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

}
