From ec54bc77093265b2b9f03eecc1507cb266683624 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 20 Feb 2014 15:21:53 +0100 Subject: Refactor update script to class and add unit test --- apps/files_sharing/appinfo/update.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'apps/files_sharing/appinfo') diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index 446c94ea540..ab32108ea25 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -72,17 +72,5 @@ if (version_compare($installedVersion, '0.3', '<')) { // clean up oc_share table from files which are no longer exists if (version_compare($installedVersion, '0.3.5.6', '<')) { - // delete all shares where the original file no longer exists - $findShares = \OC_DB::prepare('SELECT `*PREFIX*share`.`id` ' . - 'FROM `*PREFIX*share` LEFT JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid` ' . - 'WHERE `*PREFIX*filecache`.`fileid` IS NULL AND `*PREFIX*share`.`item_type` IN (\'file\', \'folder\')'); - $sharesFound = $findShares->execute(array())->fetchAll(); - - // delete those shares from the oc_share table - if (is_array($sharesFound) && !empty($sharesFound)) { - $removeShares = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `id` = ? '); - foreach ($sharesFound as $share) { - $result = $removeShares->execute(array($share['id'])); - } - } + \OC\Files\Cache\Shared_Updater::fixBrokenSharesOnAppUpdate(); } -- cgit v1.2.3