From 77e309af508dde95871b7d047cf17f55202fc2cf Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Mon, 11 Mar 2024 01:14:55 +0100 Subject: [PATCH] fix(migration): fix Attribute not found when migrating users collection This throws because Appwrite tries to migrate attributes that don't exist yet like mfaRecoveryCodes. Since the attribute doesn't exist yet, just log a warning and continue. --- src/Appwrite/Migration/Version/V20.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Migration/Version/V20.php b/src/Appwrite/Migration/Version/V20.php index 4c17290f7..730a9e701 100644 --- a/src/Appwrite/Migration/Version/V20.php +++ b/src/Appwrite/Migration/Version/V20.php @@ -127,7 +127,11 @@ class V20 extends Migration } } - $this->projectDB->updateAttribute($id, $attribute['$id'], $attribute['type']); + try { + $this->projectDB->updateAttribute($id, $attribute['$id'], $attribute['type']); + } catch (Throwable $th) { + Console::warning("'{$attribute['$id']}' from {$id}: {$th->getMessage()}"); + } } }