Merge branch 'master' of https://git.fredericofalcao.com/git/ContinuousIntegrationScript
This commit is contained in:
commit
0dbba014d8
@ -27,7 +27,7 @@ function handleTriggerExecutionResult($result, $stdout, $stderr, $originalRow, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if the new data differs from the original data
|
// Check if the new data differs from the original data
|
||||||
if ($newRowValue !== $originalRow) {
|
if (json_encode($newRowValue) !== json_encode($originalRow)) {
|
||||||
// Update the database row accordingly
|
// Update the database row accordingly
|
||||||
updateDatabaseRow($tableName, $originalRow, $newRowValue);
|
updateDatabaseRow($tableName, $originalRow, $newRowValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -180,6 +180,7 @@ function runJavascriptCodeTrigger($functionName, $activeTable, $row) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function updateDatabaseRow($tableName, $originalRow, $newRowValue) {
|
function updateDatabaseRow($tableName, $originalRow, $newRowValue) {
|
||||||
|
if (empty($originalRow) || empty($newRowValue)) return;
|
||||||
$pkColsName = getTblPrimaryKeyColName($tableName);
|
$pkColsName = getTblPrimaryKeyColName($tableName);
|
||||||
$pkColsValues = array_map(fn($cName) => $originalRow[$cName], $pkColsName);
|
$pkColsValues = array_map(fn($cName) => $originalRow[$cName], $pkColsName);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user