Also clean up the filecache table when deleting a storage entry

This commit is contained in:
Robin Appelman 2014-02-03 16:36:21 +01:00
parent b0ba69ff31
commit 118033cac6

View file

@ -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));
}
}