1
0
Fork 0
mirror of synced 2024-07-01 20:50:49 +12:00

Merge remote-tracking branch 'origin/1.3.x' into feat-db-update-migrations

# Conflicts:
#	CHANGES.md
This commit is contained in:
Jake Barnby 2023-04-12 00:39:18 +12:00
commit 9a76507185
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 22 additions and 0 deletions

View file

@ -12,6 +12,7 @@
## Bugs
- Fix not storing function's response on response codes 5xx [#4610](https://github.com/appwrite/appwrite/pull/4610)
- Fix expire to formatTz in create account session [#4985](https://github.com/appwrite/appwrite/pull/4985)
- Fix deleting projects when organization is deleted [#5335](https://github.com/appwrite/appwrite/pull/5335)
- Fix deleting collections from a project [#4983](https://github.com/appwrite/appwrite/pull/4983)
- Fix cleaning up project databases [#4984](https://github.com/appwrite/appwrite/pull/4984)
- Fix creating documents with attributes with special characters [#246](https://github.com/utopia-php/database/pull/246)

View file

@ -58,6 +58,9 @@ class DeletesV1 extends Worker
break;
case DELETE_TYPE_TEAMS:
$this->deleteMemberships($document, $project->getId());
if ($project->getId() === 'console') {
$this->deleteProjectsByTeam($document);
}
break;
case DELETE_TYPE_BUCKETS:
$this->deleteBucket($document, $project->getId());
@ -263,6 +266,24 @@ class DeletesV1 extends Worker
], $this->getProjectDB($projectId));
}
/**
* @param \Utopia\Database\Document $document
* @return void
* @throws \Exception
*/
protected function deleteProjectsByTeam(Document $document): void
{
$dbForConsole = $this->getConsoleDB();
$projects = $dbForConsole->find('projects', [
Query::equal('teamInternalId', [$document->getInternalId()])
]);
foreach ($projects as $project) {
$this->deleteProject($project);
}
}
/**
* @param Document $document project document
* @throws Exception