<?php

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

class CreateTransformativeActivityCriterion extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('transformative_activity_criterion', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('trans_action_id')->unsigned();
			$table->integer('activity_criterion_id')->unsigned();


			$table->foreign('trans_action_id')
				->references('id')
				->on('transformative_actions')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->foreign('activity_criterion_id')
				->references('id')
				->on('activity_criterion')
				->onDelete('cascade')
				->onUpdate('cascade');
		});
	}

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