Merge pull request #5077 from owncloud/no-upgrade-if-there-is-no-fscache-table-master

only perform files upgrade in case there are actually entries in the old...
This commit is contained in:
Thomas Müller 2013-10-02 14:24:38 -07:00
commit de175a4b0f
1 changed files with 9 additions and 1 deletions

View 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;
}
/**