mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #6260 from appwrite/fix-delete-project-domains
This commit is contained in:
commit
614e91b60a
1 changed files with 7 additions and 14 deletions
|
|
@ -72,7 +72,7 @@ class DeletesV1 extends Worker
|
||||||
$this->deleteInstallation($document, $project);
|
$this->deleteInstallation($document, $project);
|
||||||
break;
|
break;
|
||||||
case DELETE_TYPE_RULES:
|
case DELETE_TYPE_RULES:
|
||||||
$this->deleteRule($document, $project);
|
$this->deleteRule($document);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (\str_starts_with($document->getCollection(), 'database_')) {
|
if (\str_starts_with($document->getCollection(), 'database_')) {
|
||||||
|
|
@ -367,17 +367,8 @@ class DeletesV1 extends Worker
|
||||||
$projectId = $document->getId();
|
$projectId = $document->getId();
|
||||||
$projectInternalId = $document->getInternalId();
|
$projectInternalId = $document->getInternalId();
|
||||||
|
|
||||||
// Delete project certificates
|
|
||||||
$dbForConsole = $this->getConsoleDB();
|
$dbForConsole = $this->getConsoleDB();
|
||||||
|
|
||||||
$domains = $dbForConsole->find('domains', [
|
|
||||||
Query::equal('projectInternalId', [$projectInternalId])
|
|
||||||
]);
|
|
||||||
|
|
||||||
foreach ($domains as $domain) {
|
|
||||||
$this->deleteCertificates($domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete project tables
|
// Delete project tables
|
||||||
$dbForProject = $this->getProjectDB($document);
|
$dbForProject = $this->getProjectDB($document);
|
||||||
|
|
||||||
|
|
@ -398,10 +389,12 @@ class DeletesV1 extends Worker
|
||||||
Query::equal('projectInternalId', [$projectInternalId])
|
Query::equal('projectInternalId', [$projectInternalId])
|
||||||
], $dbForConsole);
|
], $dbForConsole);
|
||||||
|
|
||||||
// Delete Domains
|
// Delete project and function rules
|
||||||
$this->deleteByGroup('domains', [
|
$this->deleteByGroup('rules', [
|
||||||
Query::equal('projectInternalId', [$projectInternalId])
|
Query::equal('projectInternalId', [$projectInternalId])
|
||||||
], $dbForConsole);
|
], $dbForConsole, function (Document $document) {
|
||||||
|
$this->deleteRule($document);
|
||||||
|
});
|
||||||
|
|
||||||
// Delete Keys
|
// Delete Keys
|
||||||
$this->deleteByGroup('keys', [
|
$this->deleteByGroup('keys', [
|
||||||
|
|
@ -897,7 +890,7 @@ class DeletesV1 extends Worker
|
||||||
* @param Document $document rule document
|
* @param Document $document rule document
|
||||||
* @param Document $project project document
|
* @param Document $project project document
|
||||||
*/
|
*/
|
||||||
protected function deleteRule(Document $document, Document $project): void
|
protected function deleteRule(Document $document): void
|
||||||
{
|
{
|
||||||
$consoleDB = $this->getConsoleDB();
|
$consoleDB = $this->getConsoleDB();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue