Also clean up the filecache table when deleting a storage entry

remotes/origin/ldap_group_count
Robin Appelman 12 years ago
parent 8d6a3a00b4
commit 0ae4022fb4
  1. 6
      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));
}
}

Loading…
Cancel
Save