mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 18:52:53 -04:00
Also clean up the filecache table when deleting a storage entry
This commit is contained in:
parent
b0ba69ff31
commit
118033cac6
1 changed files with 6 additions and 0 deletions
6
lib/private/files/cache/storage.php
vendored
6
lib/private/files/cache/storage.php
vendored
|
|
@ -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…
Reference in a new issue