X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=536610a00e42304e5a9fbf1dc1725005ef79f842;hb=ceeb2461280da39f9b008d31e587802a7faaecc7;hp=84f895838b5ac6af2b94dcd02bcb02ada7192be7;hpb=6668066099ad6b354117f6aa721fe971868620a0;p=friendica.git diff --git a/update.php b/update.php index 84f895838b..536610a00e 100644 --- a/update.php +++ b/update.php @@ -446,7 +446,7 @@ function pre_update_1364() return Update::FAILED; } - if (!DBA::e("DELETE FROM `profile_check` WHERE NOT `uid` IN (SELECT `uid` FROM `user`)")) { + if (DBStructure::existsTable('profile_check') && !DBA::e("DELETE FROM `profile_check` WHERE NOT `uid` IN (SELECT `uid` FROM `user`)")) { return Update::FAILED; } @@ -498,7 +498,7 @@ function pre_update_1364() return Update::FAILED; } - if (!DBA::e("DELETE FROM `profile_check` WHERE NOT `cid` IN (SELECT `id` FROM `contact`)")) { + if (DBStructure::existsTable('profile_check') && !DBA::e("DELETE FROM `profile_check` WHERE NOT `cid` IN (SELECT `id` FROM `contact`)")) { return Update::FAILED; } @@ -981,3 +981,20 @@ function update_1429() return Update::SUCCESS; } + +function update_1434() +{ + $name = DI::config()->get('storage', 'name'); + + // in case of an empty config, set "Database" as default storage backend + if (empty($name)) { + DI::config()->set('storage', 'name', Storage\Database::getName()); + } + + // In case of a Using deprecated storage class value, set the right name for it + if (stristr($name, 'Friendica\Model\Storage\\')) { + DI::config()->set('storage', 'name', substr($name, 24)); + } + + return Update::SUCCESS; +}