<?php

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

class CreateCriteriaTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('criteria', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('name');
			$table->text('description12');
			$table->text('description34');
			$table->text('description56');
			$table->text('description78');
			$table->integer('outcome_id')->unsigned();

			$table->timestamps();
		});

		Schema::table('criteria', function(Blueprint $table)
		{
			$table->foreign('outcome_id')->references('id')->on('outcomes')->onDelete('cascade')->onUpdate('cascade');
		});
	}


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

}
