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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user