1
0
Fork 0
mirror of synced 2024-07-05 22:51:24 +12:00

add project

This commit is contained in:
fogelito 2024-05-28 20:37:37 +03:00
parent 75ec86eed4
commit d503a436d0

View file

@ -33,8 +33,9 @@ use Utopia\Queue\Message;
class Migrations extends Action class Migrations extends Action
{ {
protected ?Database $dbForProject = null; protected Database $dbForProject;
protected ?Database $dbForConsole = null; protected Database $dbForConsole;
protected Document $project;
public static function getName(): string public static function getName(): string
{ {
@ -81,6 +82,7 @@ class Migrations extends Action
$this->dbForProject = $dbForProject; $this->dbForProject = $dbForProject;
$this->dbForConsole = $dbForConsole; $this->dbForConsole = $dbForConsole;
$this->project = $project;
/** /**
* Handle Event execution. * Handle Event execution.
@ -92,7 +94,7 @@ class Migrations extends Action
$log->addTag('migrationId', $migration->getId()); $log->addTag('migrationId', $migration->getId());
$log->addTag('projectId', $project->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 Structure
* @throws \Utopia\Database\Exception * @throws \Utopia\Database\Exception
*/ */
protected function processMigration(Document $project, Document $migration, Log $log): void protected function processMigration(Document $migration, Log $log): void
{ {
/** $project = $this->project;
* @var Document $migrationDocument
* @var Transfer $transfer
*/
$migrationDocument = null;
$transfer = null;
$projectDocument = $this->dbForConsole->getDocument('projects', $project->getId()); $projectDocument = $this->dbForConsole->getDocument('projects', $project->getId());
$tempAPIKey = $this->generateAPIKey($projectDocument); $tempAPIKey = $this->generateAPIKey($projectDocument);