";
$has_checks= false;
-
+ $err[] = array();
foreach($map as $source_col=>$target) {
// check that source_col exists in schema.
if (!isset($this->schema[$tbl][$source_col])) {
+ $err[] = "SOURCE MISSING: $source_col => $target";
continue;
}
if (!isset($this->schema[$target_table])) {
// skip... target table does not exist
+ $err[] = "TARGET MISSING: $source_col => $target";
continue;
}
END IF;
";
- $has_checks= false;
+ $has_checks= true;
}
$ar = $this->listTriggerFunctions($tbl, 'update');
foreach($ar as $fn=>$col) {
$trigger .= "
CALL $fn(OLD.{$col}, NEW.{$col});
";
- $has_checks= false;
+ $has_checks= true;
}
$trigger .= "
";
if (!$has_checks) {
- echo "SKIP TRIGGER {$tbl}_before_update (missing links)\n";
+ echo "SKIP TRIGGER {$tbl}_before_update (missing " . implode($errs) . ")\n";
return;
}