From: Thomas Müller Date: Wed, 2 Oct 2013 11:00:05 +0000 (+0200) Subject: only perform files upgrade in case there are actually entries in the old fscache... X-Git-Tag: v6.0.0alpha2~109^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=78c60c25c86e9e00d603e29113fae3eb2f8d1bc7;p=nextcloud-server.git only perform files upgrade in case there are actually entries in the old fscache table --- diff --git a/lib/private/files/cache/upgrade.php b/lib/private/files/cache/upgrade.php index cfb9a117311..e3a46896cbf 100644 --- a/lib/private/files/cache/upgrade.php +++ b/lib/private/files/cache/upgrade.php @@ -192,7 +192,15 @@ class Upgrade { */ static function needUpgrade($user) { $cacheVersion = (int)\OCP\Config::getUserValue($user, 'files', 'cache_version', 4); - return $cacheVersion < 5; + if ($cacheVersion < 5) { + $legacy = new \OC\Files\Cache\Legacy($user); + if ($legacy->hasItems()) { + return true; + } + self::upgradeDone($user); + } + + return false; } /**