<?php

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

class CreateCriterionScaleTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('criterion_scale', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('scale_id')->unsigned();
			$table->integer('criterion_id')->unsigned();
			$table
				->foreign('scale_id')
				->references('id')
				->on('scales')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table
				->foreign('criterion_id')
				->references('id')
				->on('criteria')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->timestamps();
		});
	
	}

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

}
