diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-03 16:36:21 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-03 16:36:21 +0100 |
commit | 0ae4022fb4fc6ade3ed300205ccdcdd32863dcdc (patch) | |
tree | c0f155078340f150669a62b7bdd0cb0601a3e5bd | |
parent | 8d6a3a00b47aa7d034de378f498a7d5e329a8e1d (diff) | |
download | nextcloud-server-0ae4022fb4fc6ade3ed300205ccdcdd32863dcdc.tar.gz nextcloud-server-0ae4022fb4fc6ade3ed300205ccdcdd32863dcdc.zip |
Also clean up the filecache table when deleting a storage entry
-rw-r--r-- | lib/private/files/cache/storage.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php index 6d7a1002c1b..5b1b30176e8 100644 --- a/lib/private/files/cache/storage.php +++ b/lib/private/files/cache/storage.php @@ -77,10 +77,16 @@ class Storage { * @param string $storageId */ public static function remove($storageId) { + $storageCache = new Storage($storageId); + $numericId = $storageCache->getNumericId(); + if (strlen($storageId) > 64) { $storageId = md5($storageId); } $sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?'; \OC_DB::executeAudited($sql, array($storageId)); + + $sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?'; + \OC_DB::executeAudited($sql, array($numericId)); } } |