X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDatabase%2FView.php;h=e0d30481524d3bb0c6fe07b2806dfaa202b5c1cc;hb=f26226229a45af4053055b8a5ea7aa0f7aa33e0c;hp=51d051786dc89b1e4de0ea89b53cb887d033e388;hpb=d05d5a038143b82ae512b435573ebf7d0b275e85;p=friendica.git diff --git a/src/Database/View.php b/src/Database/View.php index 51d051786d..e0d3048152 100644 --- a/src/Database/View.php +++ b/src/Database/View.php @@ -1,6 +1,6 @@ $structure) { @@ -112,16 +126,16 @@ class View } if (self::isView($name)) { - $sql = sprintf("DROP VIEW `%s`", DBA::escape($name)); + $sql = sprintf("DROP VIEW IF EXISTS `%s`", DBA::escape($name)); } elseif (self::isTable($name)) { - $sql = sprintf("DROP TABLE `%s`", DBA::escape($name)); + $sql = sprintf("DROP TABLE IF EXISTS `%s`", DBA::escape($name)); } - if ($verbose) { + if (!empty($sql) && $verbose) { echo $sql . ";\n"; } - if ($action) { + if (!empty($sql) && $action) { DBA::e($sql); } @@ -158,7 +172,7 @@ class View } /** - * Check if the given table/view is a view + * Check if the given table/view is a table * * @param string $table * @return boolean "true" if it's a table