<?php

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

class CreatePathsForAnnualPlan extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('paths_for_annual_plans', function (Blueprint $table) {
			$table->increments('id');
			$table->string("path_to_pdf");
			$table->integer('annual_plan_id')->unsigned();
			$table->boolean("last");
			$table->foreign('annual_plan_id')
				->references('id')
				->on('annual_plans')
				->onUpdate('cascade')
				->onDelete('cascade');
		});
	}

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