1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 13:35:56 +00:00

actually check for failures properly in the dbupdater

This commit is contained in:
Andrew Dolgov
2016-04-26 20:04:24 +03:00
parent 9e84bab449
commit 977cea1438
9 changed files with 44 additions and 11 deletions

View File

@@ -30,7 +30,7 @@ class DbUpdater {
}
}
function performUpdateTo($version) {
function performUpdateTo($version, $html_output = true) {
if ($this->getSchemaVersion() == $version - 1) {
$lines = $this->getSchemaLines($version);
@@ -41,7 +41,17 @@ class DbUpdater {
foreach ($lines as $line) {
if (strpos($line, "--") !== 0 && $line) {
db_query($line);
if (!db_query($line, false)) {
if ($html_output) {
print_notice("Query: $line");
print_error("Error: " . db_last_query_error());
} else {
_debug("Query: $line");
_debug("Error: " . db_last_query_error());
}
return false;
}
}
}