Implement Migrations API#5437
Conversation
| ], | ||
| [ | ||
| '$id' => ID::custom('statusCounters'), | ||
| 'type' => Database::VAR_STRING, |
There was a problem hiding this comment.
Apply proper changes according to changes required in the response model. Both structures should be pretty similar.
| '$id' => '_key_statusCounters', | ||
| 'type' => Database::INDEX_KEY, | ||
| 'attributes' => ['statusCounters'], | ||
| 'lengths' => [Database::LENGTH_KEY], |
There was a problem hiding this comment.
statusCounters attribute size is 3000, Only 255 chars (Database::LENGTH_KEY) will be indexes.
Please double-check if it is enough for your queries, can be up to 768 MAX.
There was a problem hiding this comment.
We don't perform any queries on this attribute, we may be best off just not having a index for it
christyjacob4
left a comment
There was a problem hiding this comment.
Please address the comments
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
abnegate
left a comment
There was a problem hiding this comment.
Looking good, just a few comments on style and consistency. Let's merge in 1.4.x to bring it up to date and resolve conflicts as well
| // $migration = $dbForProject->createDocument('migrations', new Document([ | ||
| // '$id' => ID::unique(), | ||
| // 'status' => 'pending', | ||
| // 'stage' => 'init', | ||
| // 'source' => Firebase::getName(), | ||
| // 'credentials' => [ | ||
| // 'serviceAccount' => $serviceAccount, | ||
| // ], | ||
| // 'resources' => $resources, | ||
| // 'statusCounters' => '{}', | ||
| // 'resourceData' => "{}", | ||
| // 'errors' => [] | ||
| // ])); | ||
|
|
||
| // $eventsInstance->setParam('migrationId', $migration->getId()); | ||
|
|
||
| // // Trigger Transfer | ||
| // $event = new Migration(); | ||
| // $event | ||
| // ->setMigration($migration) | ||
| // ->setProject($project) | ||
| // ->setUser($user) | ||
| // ->trigger(); | ||
|
|
||
| // $response | ||
| // ->setStatusCode(Response::STATUS_CODE_ACCEPTED) | ||
| // ->dynamic($migration, Response::MODEL_MIGRATION); |
There was a problem hiding this comment.
Do we need this code or can it be removed?
There was a problem hiding this comment.
This code was commented out as I was still working on the code that generates a service account and didn't want to start a transfer everytime
There was a problem hiding this comment.
It will be uncommented once I'm done with that
|
Hm, I wonder where all those changes came from. It's rolling back loads. Going to try and fix this now, I'm going create a whole new branch based off 1.4.x and move the migration stuff over to handle this messy conflict |
|
Due to the weird collision issues that occured, I've gone ahead and move to a new branch with a clean slate based off 1.4.x. Please review this PR instead: #5938 |
What does this PR do?
Implement Migrations API
Checklist