From: Alan Knowles Date: Thu, 16 Apr 2015 05:15:23 +0000 (+0800) Subject: UpdateDatabase/MysqlLinks.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=f06051951d52006d0027f995c1277e9439a36dd2 UpdateDatabase/MysqlLinks.php --- diff --git a/UpdateDatabase/MysqlLinks.php b/UpdateDatabase/MysqlLinks.php index c6038542..829293f3 100644 --- a/UpdateDatabase/MysqlLinks.php +++ b/UpdateDatabase/MysqlLinks.php @@ -193,6 +193,14 @@ class Pman_Core_UpdateDatabase_MysqlLinks { END IF; "; } + + $ar = $this->listTriggerFunctions($tbl, 'delete'); + foreach($ar as $fn=>$col) { + $trigger .= " + CALL $fn( OLD.{$col}); + "; + } + $trigger .= " END @@ -257,7 +265,7 @@ class Pman_Core_UpdateDatabase_MysqlLinks { } - $ar = $this->listTriggerFunctions($tbl, 'update'); + $ar = $this->listTriggerFunctions($tbl, 'insert'); foreach($ar as $fn=>$col) { $trigger .= " CALL $fn( NEW.{$col});