<?php

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

class AddForeignKeysToSige.lotesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('sige.lotes', function(Blueprint $table)
		{
			$table->foreign('situacao_juridica_id', 'fk6lkvdhopqcod3gskomdxkfamx')->references('id')->on('sige.situacoes_juridicas')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('situacao_juridica_id', 'fk8c22d30560bab12f')->references('id')->on('sige.situacoes_juridicas')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('modificado_por_id', 'fk8c22d30562f306bd')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('criado_por_id', 'fk8c22d30575c5065e')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('municipio_id', 'fk8c22d3057bd78ff4')->references('id')->on('sige.municipios')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('criado_por_id', 'fkcii953vpjpmou40rxokli4sim')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('municipio_id', 'fkcl79m7cgqcc9saq3k38mte6qx')->references('id')->on('ibge.municipios')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('modificado_por_id', 'fkj71rlmgnl97lrvpik2vyipm0r')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('municipio_id', 'fk8c22d3059e521211')->references('id')->on('ibge.municipios')->onUpdate('RESTRICT')->onDelete('RESTRICT');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('sige.lotes', function(Blueprint $table)
		{
			$table->dropForeign('fk6lkvdhopqcod3gskomdxkfamx');
			$table->dropForeign('fk8c22d30560bab12f');
			$table->dropForeign('fk8c22d30562f306bd');
			$table->dropForeign('fk8c22d30575c5065e');
			$table->dropForeign('fk8c22d3057bd78ff4');
			$table->dropForeign('fkcii953vpjpmou40rxokli4sim');
			$table->dropForeign('fkcl79m7cgqcc9saq3k38mte6qx');
			$table->dropForeign('fkj71rlmgnl97lrvpik2vyipm0r');
			$table->dropForeign('fk8c22d3059e521211');
		});
	}

}
