<?php

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

class AddForeignKeysToSige.processosTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('sige.processos', function(Blueprint $table)
		{
			$table->foreign('lote_id', 'fkc504ecd92c5903a0')->references('id')->on('sige.lotes')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('pendencia_id', 'fkc504ecd957a7d5b4')->references('id')->on('sige.pendencias')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('modificado_por_id', 'fkc504ecd962f306bd')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('etapa_id', 'fkc504ecd96fed6d34')->references('id')->on('sige.etapas')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('criado_por_id', 'fkc504ecd975c5065e')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
			$table->foreign('conferido_por_id', 'fkc504ecd9fa77078d')->references('id')->on('sec_user')->onUpdate('RESTRICT')->onDelete('RESTRICT');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('sige.processos', function(Blueprint $table)
		{
			$table->dropForeign('fkc504ecd92c5903a0');
			$table->dropForeign('fkc504ecd957a7d5b4');
			$table->dropForeign('fkc504ecd962f306bd');
			$table->dropForeign('fkc504ecd96fed6d34');
			$table->dropForeign('fkc504ecd975c5065e');
			$table->dropForeign('fkc504ecd9fa77078d');
		});
	}

}
