From 998e7a11bf82e073880d4983dd7b1fb62e574ea5 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 15:22:37 +0530 Subject: [PATCH] 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()}"); }