Skip to content

Commit

Permalink
fix: erro ao subir ambiente do sqlserver.
Browse files Browse the repository at this point in the history
  • Loading branch information
mateussbh committed Aug 30, 2024
1 parent cd934e8 commit db485bc
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/scripts/sei_atualizar_versao_modulo_pen.php
Original file line number Diff line number Diff line change
Expand Up @@ -2885,7 +2885,13 @@ protected function instalarV3070()

// Alterar id da tabela
$this->excluirChaveEstrangeira("md_pen_rel_expedir_lote", "fk_md_pen_rel_expedir_lote", true);
$objMetaBD->renomearColuna('md_pen_expedir_lote', 'id_lote', 'id_bloco_processo', $objMetaBD->tipoNumero());
try {
$objMetaBD->renomearColuna("md_pen_expedir_lote", "id_lote", "id_bloco_processo", $objMetaBD->tipoNumero());
} catch (Exception $e) {
if (strpos($e->__toString(), 'Caution: Changing any part of an object name could break scripts and stored procedures.') === false) {
throw $e;
}
}

// Adicionar coluna de atualização do registro
$objMetaBD->adicionarColuna('md_pen_expedir_lote', 'dth_atualizado', $objMetaBD->tipoDataHora(), PenMetaBD::SNULLO);
Expand All @@ -2902,8 +2908,13 @@ protected function instalarV3070()
$this->excluirChaveEstrangeira("md_pen_expedir_lote", "fk_bloco_protocolo", true);
$this->excluirChaveEstrangeira("md_pen_rel_expedir_lote", "fk_md_pen_rel_expedir_lote", true);
$this->excluirChaveEstrangeira("md_pen_bloco_protocolo", "fk_bloco_protocolo", true);

$objMetaBD->novoRenomearTabela("md_pen_expedir_lote", "md_pen_bloco_processo");
try {
$objMetaBD->novoRenomearTabela("md_pen_expedir_lote", "md_pen_bloco_processo");
} catch (Exception $e) {
if (strpos($e->__toString(), 'Caution: Changing any part of an object name could break scripts and stored procedures.') === false) {
throw $e;
}
}

$objMetaBD->adicionarChaveEstrangeira("fk_md_pen_bloco_proc_procedi", "md_pen_bloco_processo", array('id_protocolo'), "protocolo", array('id_protocolo'), false);
$objMetaBD->adicionarChaveEstrangeira("fk_md_pen_bloco_processo_bl", "md_pen_bloco_processo", array('id_bloco'), "md_pen_bloco", array('id'), false);
Expand Down

0 comments on commit db485bc

Please sign in to comment.