diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-04-01 14:56:37 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-04-01 14:56:37 +0200 |
commit | 27eff1ac30948fb3810efa0577ee729712a9652d (patch) | |
tree | bee72a606800e509a1698c74c0615677eef116f3 /apps/files_sharing/appinfo | |
parent | a17933577511239749c3edefea0eba3106a82155 (diff) | |
parent | cbfd16089b8c4317dc831dbab52f36f2ad60c5c0 (diff) | |
download | nextcloud-server-27eff1ac30948fb3810efa0577ee729712a9652d.tar.gz nextcloud-server-27eff1ac30948fb3810efa0577ee729712a9652d.zip |
Merge pull request #7293 from owncloud/update-shares-postgres
fix update to remove shares where file doesn't exist on postgres
Diffstat (limited to 'apps/files_sharing/appinfo')
-rw-r--r-- | apps/files_sharing/appinfo/update.php | 17 | ||||
-rw-r--r-- | apps/files_sharing/appinfo/version | 2 |
2 files changed, 3 insertions, 16 deletions
diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index 4b716e764f4..ab32108ea25 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -71,19 +71,6 @@ 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', '<')) { - - // get all shares where the original file no longer exists - $findShares = \OC_DB::prepare('SELECT `file_source` 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)) { - $delArray = array(); - foreach ($sharesFound as $share) { - $delArray[] = $share['file_source']; - } - $removeShares = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source` IN (?)'); - $result = $removeShares->execute(array(implode(',', $delArray))); - } +if (version_compare($installedVersion, '0.3.5.6', '<')) { + \OC\Files\Cache\Shared_Updater::fixBrokenSharesOnAppUpdate(); } diff --git a/apps/files_sharing/appinfo/version b/apps/files_sharing/appinfo/version index 09e9157034c..8f91d33378e 100644 --- a/apps/files_sharing/appinfo/version +++ b/apps/files_sharing/appinfo/version @@ -1 +1 @@ -0.3.5
\ No newline at end of file +0.3.5.6 |