<?php

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

class CreateOutcomesTable extends Migration
{

	public function up()
	{
		Schema::create('outcomes', function (Blueprint $table) {
			$table->increments('id');
			$table->string('name');
			$table->text('definition');
			$table->decimal('expected_outcome', 5, 2)->default('66.66');
			$table->timestamps();
			$table->softDeletes();
			$table->integer('new_outcome_id')->unsigned()->nullable();
			$table->date('deactivation_date')->nullable();

			$table->foreign('new_outcome_id')->references('id')->on('outcomes');
			$table->smallInteger('level');
			$table->date('activation_date');
		});
	}


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