From 43946cade51120cec57d0274c669c7138c137bff Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 12 Apr 2023 00:33:29 +1200 Subject: [PATCH] Add teams migration --- src/Appwrite/Migration/Version/V18.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Migration/Version/V18.php b/src/Appwrite/Migration/Version/V18.php index aa7ee165a8..8f11e37a22 100644 --- a/src/Appwrite/Migration/Version/V18.php +++ b/src/Appwrite/Migration/Version/V18.php @@ -58,7 +58,7 @@ class V18 extends Migration if ($attribute['type'] !== Database::VAR_FLOAT) { continue; } - $this->changeAttributeInternalType($collectionTable, $attribute['$id'], 'DOUBLE'); + $this->changeAttributeInternalType($collectionTable, $attribute['key'], 'DOUBLE'); } } } @@ -95,6 +95,17 @@ class V18 extends Migration Console::warning("'passwordHistory' from {$id}: {$th->getMessage()}"); } break; + case 'teams': + try { + /** + * Create 'prefs' attribute + */ + $this->createAttributeFromCollection($this->projectDB, $id, 'prefs'); + $this->projectDB->deleteCachedCollection($id); + } catch (\Throwable $th) { + Console::warning("'prefs' from {$id}: {$th->getMessage()}"); + } + break; default: break; } @@ -132,6 +143,12 @@ class V18 extends Migration */ $document->setAttribute('passwordHistory', []); break; + case 'teams': + /** + * Default prefs + */ + $document->setAttribute('prefs', new \stdClass()); + break; } return $document;