fix(migration): prepare filter migration
This commit is contained in:
parent
bc71a1868b
commit
d41ee76d36
|
@ -3,6 +3,7 @@
|
|||
namespace Appwrite\Migration\Version;
|
||||
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Config\Config;
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Document;
|
||||
use Appwrite\Migration\Migration;
|
||||
|
@ -13,12 +14,13 @@ class V06 extends Migration
|
|||
{
|
||||
Console::log('I got nothing to do. Yet.');
|
||||
|
||||
//TODO: migrate new `filter` property
|
||||
$this->forEachDocument([$this, 'fixDocument']);
|
||||
}
|
||||
|
||||
protected function fixDocument(Document $document)
|
||||
{
|
||||
$providers = Config::getParam('providers');
|
||||
|
||||
switch ($document->getAttribute('$collection')) {
|
||||
case Database::SYSTEM_COLLECTION_USERS:
|
||||
if ($document->getAttribute('password-update', null)) {
|
||||
|
@ -26,6 +28,26 @@ class V06 extends Migration
|
|||
->setAttribute('passwordUpdate', $document->getAttribute('password-update', $document->getAttribute('passwordUpdate', '')))
|
||||
->removeAttribute('password-update');
|
||||
}
|
||||
if($document->getAttribute('prefs', null)) {
|
||||
//TODO: take care of filter ['json']
|
||||
}
|
||||
break;
|
||||
case Database::SYSTEM_COLLECTION_WEBHOOKS:
|
||||
if($document->getAttribute('httpPass', null)) {
|
||||
//TODO: take care of filter ['encrypt']
|
||||
}
|
||||
break;
|
||||
case Database::SYSTEM_COLLECTION_TASKS:
|
||||
if($document->getAttribute('httpPass', null)) {
|
||||
//TODO: take care of filter ['encrypt']
|
||||
}
|
||||
break;
|
||||
case Database::SYSTEM_COLLECTION_PROJECTS:
|
||||
foreach ($providers as $key => $provider) {
|
||||
if ($document->getAttribute('usersOauth' . \ucfirst($key) . 'Secret')) {
|
||||
//TODO: take care of filter ['encrypt]
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $document;
|
||||
|
|
Loading…
Reference in a new issue