- // update the structure in one call
- $retval = DBStructure::update($basePath, $verbose, true);
- if (!empty($retval)) {
- if ($sendMail) {
- self::updateFailed(
- DB_UPDATE_VERSION,
- $retval
- );
+ // update the structure in one call
+ $retval = DBStructure::update($basePath, $verbose, true);
+ if (!empty($retval)) {
+ if ($sendMail) {
+ self::updateFailed(
+ DB_UPDATE_VERSION,
+ $retval
+ );
+ }
+ Logger::error('Update ERROR.', ['from' => $stored, 'to' => $current, 'retval' => $retval]);
+ Config::set('system', 'update', Update::FAILED);
+ Lock::release('dbupdate');
+ return $retval;
+ } else {
+ Config::set('database', 'last_successful_update', $current);
+ Config::set('database', 'last_successful_update_time', time());
+ Logger::info('Update finished.', ['from' => $stored, 'to' => $current]);