From cd42a8a481d8c54ac4c12d3a1b63c038f398077a Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 16 Apr 2015 15:30:47 +0800 Subject: [PATCH] UpdateDatabase/MysqlLinks.php --- UpdateDatabase/MysqlLinks.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/UpdateDatabase/MysqlLinks.php b/UpdateDatabase/MysqlLinks.php index 748bd340..98a0f20c 100644 --- a/UpdateDatabase/MysqlLinks.php +++ b/UpdateDatabase/MysqlLinks.php @@ -258,6 +258,13 @@ class Pman_Core_UpdateDatabase_MysqlLinks { $source_tbl = $tbl; list($target_table , $target_col) = explode(':', $target); + + if (!isset($this->schema[$target_table])) { + // skip... target table does not exist + continue; + } + + $err = substr("Fail: INSERT referenced {$tbl}:{$source_col}", 0, 64); $trigger .=" SET mid = 0; @@ -332,6 +339,11 @@ class Pman_Core_UpdateDatabase_MysqlLinks { $source_tbl = $tbl; list($target_table , $target_col) = explode(':', $target); + if (!isset($this->schema[$target_table])) { + // skip... target table does not exist + continue; + } + $err = substr("Fail: UPDATE referenced {$tbl}:$source_col", 0, 64); $trigger .=" SET mid = 0; -- 2.39.2