1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

Merge pull request #6260 from appwrite/fix-delete-project-domains

This commit is contained in:
Torsten Dittmann 2023-09-24 01:54:28 +02:00 committed by GitHub
commit 614e91b60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ class DeletesV1 extends Worker
$this->deleteInstallation($document, $project);
break;
case DELETE_TYPE_RULES:
$this->deleteRule($document, $project);
$this->deleteRule($document);
break;
default:
if (\str_starts_with($document->getCollection(), 'database_')) {
@ -367,17 +367,8 @@ class DeletesV1 extends Worker
$projectId = $document->getId();
$projectInternalId = $document->getInternalId();
// Delete project certificates
$dbForConsole = $this->getConsoleDB();
$domains = $dbForConsole->find('domains', [
Query::equal('projectInternalId', [$projectInternalId])
]);
foreach ($domains as $domain) {
$this->deleteCertificates($domain);
}
// Delete project tables
$dbForProject = $this->getProjectDB($document);
@ -398,10 +389,12 @@ class DeletesV1 extends Worker
Query::equal('projectInternalId', [$projectInternalId])
], $dbForConsole);
// Delete Domains
$this->deleteByGroup('domains', [
// Delete project and function rules
$this->deleteByGroup('rules', [
Query::equal('projectInternalId', [$projectInternalId])
], $dbForConsole);
], $dbForConsole, function (Document $document) {
$this->deleteRule($document);
});
// Delete Keys
$this->deleteByGroup('keys', [
@ -897,7 +890,7 @@ class DeletesV1 extends Worker
* @param Document $document rule document
* @param Document $project project document
*/
protected function deleteRule(Document $document, Document $project): void
protected function deleteRule(Document $document): void
{
$consoleDB = $this->getConsoleDB();