From d503a436d02a99ea123c7c4adcdf42664b6c90b7 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 28 May 2024 20:37:37 +0300 Subject: [PATCH] add project --- src/Appwrite/Platform/Workers/Migrations.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 13f53277ee..dc8db4d626 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -33,8 +33,9 @@ use Utopia\Queue\Message; class Migrations extends Action { - protected ?Database $dbForProject = null; - protected ?Database $dbForConsole = null; + protected Database $dbForProject; + protected Database $dbForConsole; + protected Document $project; public static function getName(): string { @@ -81,6 +82,7 @@ class Migrations extends Action $this->dbForProject = $dbForProject; $this->dbForConsole = $dbForConsole; + $this->project = $project; /** * Handle Event execution. @@ -92,7 +94,7 @@ class Migrations extends Action $log->addTag('migrationId', $migration->getId()); $log->addTag('projectId', $project->getId()); - $this->processMigration($project, $migration, $log); + $this->processMigration($migration, $log); } /** @@ -268,14 +270,9 @@ class Migrations extends Action * @throws Structure * @throws \Utopia\Database\Exception */ - protected function processMigration(Document $project, Document $migration, Log $log): void + protected function processMigration(Document $migration, Log $log): void { - /** - * @var Document $migrationDocument - * @var Transfer $transfer - */ - $migrationDocument = null; - $transfer = null; + $project = $this->project; $projectDocument = $this->dbForConsole->getDocument('projects', $project->getId()); $tempAPIKey = $this->generateAPIKey($projectDocument);