]> source.dussan.org Git - nextcloud-server.git/commitdiff
only perform files upgrade in case there are actually entries in the old fscache...
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 2 Oct 2013 11:00:05 +0000 (13:00 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 2 Oct 2013 11:00:05 +0000 (13:00 +0200)
lib/private/files/cache/upgrade.php

index cfb9a1173113fffd6f278acb780a05e87879001d..e3a46896cbfa49a18f26d0d2446346a170a61a9f 100644 (file)
@@ -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;
        }
 
        /**