some dbupdater improvements; fix schema 136 syntax for mysql
This commit is contained in:
parent
0d04e21006
commit
0881d0a00d
|
@ -52,7 +52,7 @@ class DbUpdater {
|
|||
$this->pdo->query($line); // PDO returns errors as exceptions now
|
||||
} catch (PDOException $e) {
|
||||
if ($html_output) {
|
||||
print_error("Error: " . implode(", ", $this->pdo->errorInfo()));
|
||||
print "<div class='text-error'>Error: " . implode(", ", $this->pdo->errorInfo()) . "</div>";
|
||||
} else {
|
||||
Debug::log("Error: " . implode(", ", $this->pdo->errorInfo()));
|
||||
}
|
||||
|
|
|
@ -1133,25 +1133,32 @@ class Handler_Public extends Handler {
|
|||
if ($op == "performupdate") {
|
||||
if ($updater->isUpdateRequired()) {
|
||||
|
||||
print "<h2>" . __("Performing updates") . "</h2>";
|
||||
|
||||
print "<h3>" . T_sprintf("Updating to schema version %d", SCHEMA_VERSION) . "</h3>";
|
||||
print "<h2>" . T_sprintf("Performing updates to schema version %d", SCHEMA_VERSION) . "</h2>";
|
||||
|
||||
for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
|
||||
print_notice(T_sprintf("Performing update up to version %d...", $i));
|
||||
print "<ul>";
|
||||
|
||||
print "<li class='text-info'>" . T_sprintf("Updating to version %d", $i) . "</li>";
|
||||
|
||||
print "<li>";
|
||||
$result = $updater->performUpdateTo($i, true);
|
||||
print "</li>";
|
||||
|
||||
if (!$result) {
|
||||
print "<span class='err'>".__("FAILED!")."</span></li></ul>";
|
||||
print "</ul>";
|
||||
|
||||
print_warning("One of the updates failed. Either retry the process or perform updates manually.");
|
||||
print_error("One of the updates failed. Either retry the process or perform updates manually.");
|
||||
|
||||
print "<a href='index.php'>".__("Return to Tiny Tiny RSS")."</a>";
|
||||
print "<form method='POST'>
|
||||
<input type='hidden' name='subop' value='performupdate'>
|
||||
<button type='submit' dojoType='dijit.form.Button' class='alt-danger' onclick='return confirmOP()'>".__("Try again")."</button>
|
||||
<a href='index.php'>".__("Return to Tiny Tiny RSS")."</a>
|
||||
</form>";
|
||||
|
||||
return;
|
||||
} else {
|
||||
print "<span class='ok'>".__("OK!")."</span></li>";
|
||||
print "<li class='text-success'>" . __("Completed.") . "</li>";
|
||||
print "</ul>";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
begin;
|
||||
|
||||
alter table ttrss_archived_feeds add column created datetime;
|
||||
update ttrss_version set schema_version = 136;
|
||||
alter table ttrss_archived_feeds alter column created set not null;
|
||||
|
||||
update ttrss_archived_feeds set created = NOW();
|
||||
alter table ttrss_archived_feeds change created created bool not null;
|
||||
|
||||
update ttrss_version set schema_version = 136;
|
||||
|
||||
commit;
|
||||
|
|
Loading…
Reference in New Issue