<?php

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

class CreateNewRubricActivityTable extends Migration {

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

			$table
                ->foreign('rubric_id')
                ->references('id')
                ->on('rubrics')
                ->onDelete('cascade')
                ->onUpdate('cascade');
			$table
                ->foreign('activity_id')
                ->references('id')
                ->on('activities')
                ->onDelete('cascade')
                ->onUpdate('cascade');
		});
	}


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

}
