<?php

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

class CreateAssessmentsTable extends Migration
{

	public function up()
	{
		Schema::create('assessments', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('student_id')->unsigned();
			$table->integer('activity_criterion_id')->unsigned();
			$table->integer('score');
			$table
				->foreign('student_id')
				->references('id')
				->on('students')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table
				->foreign('activity_criterion_id')
				->references('id')
				->on('activity_criterion')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->timestamps();
		});
	}

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