From 1082973fddcf82934d66bab6240e81209176b9ce Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 15:03:57 +0530 Subject: [PATCH 1/2] fix(vcs): store installation tokens as text instead of sized string --- app/config/collections/platform.php | 8 ++++---- src/Appwrite/Migration/Version/V25.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 9fd0667d17..d02b8d2ca3 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -1840,9 +1840,9 @@ $platformCollections = [ ], [ '$id' => ID::custom('personalAccessToken'), - 'type' => Database::VAR_STRING, + 'type' => Database::VAR_TEXT, 'format' => '', - 'size' => 2048, + 'size' => 0, 'signed' => true, 'required' => false, 'default' => null, @@ -1862,9 +1862,9 @@ $platformCollections = [ ], [ '$id' => ID::custom('personalRefreshToken'), - 'type' => Database::VAR_STRING, + 'type' => Database::VAR_TEXT, 'format' => '', - 'size' => 2048, + 'size' => 0, 'signed' => true, 'required' => false, 'default' => null, diff --git a/src/Appwrite/Migration/Version/V25.php b/src/Appwrite/Migration/Version/V25.php index 0d42606a7f..17ed49b73d 100644 --- a/src/Appwrite/Migration/Version/V25.php +++ b/src/Appwrite/Migration/Version/V25.php @@ -74,9 +74,9 @@ class V25 extends Migration if ($collectionType === 'console') { foreach (['personalAccessToken', 'personalRefreshToken'] as $attribute) { try { - $this->dbForProject->updateAttribute($id, $attribute, size: 2048); + $this->dbForProject->updateAttribute($id, $attribute, type: Database::VAR_TEXT, size: 0); } catch (Throwable $th) { - Console::warning("Failed to resize attribute \"{$attribute}\" in collection {$id}: {$th->getMessage()}"); + Console::warning("Failed to convert attribute \"{$attribute}\" to text in collection {$id}: {$th->getMessage()}"); } } } From 998e7a11bf82e073880d4983dd7b1fb62e574ea5 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 15:22:37 +0530 Subject: [PATCH 2/2] fix(vcs): size the token columns as every other text column is A text column is capped at 65535 bytes whatever size it declares, and 0 declares no cap of its own, so both store the same tokens. Every other text column in these configs states the cap it holds, and these two now read the same way. --- app/config/collections/platform.php | 4 ++-- src/Appwrite/Migration/Version/V25.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index d02b8d2ca3..c335a13471 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -1842,7 +1842,7 @@ $platformCollections = [ '$id' => ID::custom('personalAccessToken'), 'type' => Database::VAR_TEXT, 'format' => '', - 'size' => 0, + 'size' => 65535, 'signed' => true, 'required' => false, 'default' => null, @@ -1864,7 +1864,7 @@ $platformCollections = [ '$id' => ID::custom('personalRefreshToken'), 'type' => Database::VAR_TEXT, 'format' => '', - 'size' => 0, + 'size' => 65535, 'signed' => true, 'required' => false, 'default' => null, diff --git a/src/Appwrite/Migration/Version/V25.php b/src/Appwrite/Migration/Version/V25.php index 17ed49b73d..c26db65002 100644 --- a/src/Appwrite/Migration/Version/V25.php +++ b/src/Appwrite/Migration/Version/V25.php @@ -74,7 +74,7 @@ class V25 extends Migration if ($collectionType === 'console') { foreach (['personalAccessToken', 'personalRefreshToken'] as $attribute) { try { - $this->dbForProject->updateAttribute($id, $attribute, type: Database::VAR_TEXT, size: 0); + $this->dbForProject->updateAttribute($id, $attribute, type: Database::VAR_TEXT, size: Database::MAX_TEXT_BYTES); } catch (Throwable $th) { Console::warning("Failed to convert attribute \"{$attribute}\" to text in collection {$id}: {$th->getMessage()}"); }