<?php

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

class AddForeignKeysToSige.municipiosTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('sige.municipios', function(Blueprint $table)
		{
			$table->foreign('modificado_por_id', 'fk8d15cea062f306bd')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('criado_por_id', 'fk8d15cea075c5065e')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('nom_id', 'fk8d15cea0cb063b14')->references('id')->on('sige.noms')->onUpdate('RESTRICT')->onDelete('RESTRICT');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('sige.municipios', function(Blueprint $table)
		{
			$table->dropForeign('fk8d15cea062f306bd');
			$table->dropForeign('fk8d15cea075c5065e');
			$table->dropForeign('fk8d15cea0cb063b14');
		});
	}

}
