<?php

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

class AddDateToPathsForAnnualPlans extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('paths_for_annual_plans', function (Blueprint $t) {
			$t->date("date_posted");
			$t->integer('user_id')->unsigned();
			$t->foreign('user_id')
				->references('id')
				->on('users');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('paths_for_annual_plans', function (Blueprint $t) {
			$t->dropColumn("date_posted");
			$t->dropColumn("user_id");
		});
	}
}