<?php

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

class PathToThreeYearPlan extends Migration
{

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

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