summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-02 13:00:05 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-02 13:00:05 +0200
commit78c60c25c86e9e00d603e29113fae3eb2f8d1bc7 (patch)
tree3bc2551584e3a18c9951782e2ceadfea6a5c5dcf /lib
parent1adadf36fca29f7d688bcbf84ae53f6ecc16e53c (diff)
downloadnextcloud-server-78c60c25c86e9e00d603e29113fae3eb2f8d1bc7.tar.gz
nextcloud-server-78c60c25c86e9e00d603e29113fae3eb2f8d1bc7.zip
only perform files upgrade in case there are actually entries in the old fscache table
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/cache/upgrade.php10
1 files changed, 9 insertions, 1 deletions
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;
}
/**