mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
delete deleteCollection
This commit is contained in:
parent
e627cab92e
commit
d5bf134c92
1 changed files with 1 additions and 16 deletions
|
|
@ -498,25 +498,13 @@ class Deletes extends Action
|
|||
];
|
||||
|
||||
$limit = \count($projectCollectionIds) + 25;
|
||||
$junctions = [];
|
||||
|
||||
while (true) {
|
||||
$collections = $dbForProject->listCollections($limit);
|
||||
|
||||
foreach ($collections as $collection) {
|
||||
if ($dsn->getHost() !== System::getEnv('_APP_DATABASE_SHARED_TABLES', '') || !\in_array($collection->getId(), $projectCollectionIds)) {
|
||||
try {
|
||||
$dbForProject->deleteCollection($collection->getId());
|
||||
} catch (Throwable $e) {
|
||||
Console::error('Error deleting '.$collection->getId().' '.$e->getMessage());
|
||||
|
||||
/**
|
||||
* Ignore junction tables;
|
||||
*/
|
||||
if (!preg_match('/^_\d+_\d+$/', $collection->getId())) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
$dbForProject->deleteCollection($collection->getId());
|
||||
} else {
|
||||
$this->deleteByGroup($collection->getId(), [], database: $dbForProject);
|
||||
}
|
||||
|
|
@ -582,9 +570,6 @@ class Deletes extends Action
|
|||
$this->deleteByGroup('_metadata', [], $dbForProject);
|
||||
}
|
||||
|
||||
|
||||
Console::error('deviceForFiles === ' . $deviceForFiles->getRoot());
|
||||
|
||||
// Delete all storage directories
|
||||
$deviceForFiles->delete($deviceForFiles->getRoot(), true);
|
||||
$deviceForFunctions->delete($deviceForFunctions->getRoot(), true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue