From 1559fec29aef29595587ef89c161fe48ff0567f8 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:53:18 -0400 Subject: [PATCH] fix: Increasing buckets metadata --- app/config/collections.php | 2 +- src/Appwrite/Migration/Version/V21.php | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/config/collections.php b/app/config/collections.php index b8667d0b8d..e4dadcf0fc 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -5772,7 +5772,7 @@ $bucketCollections = [ '$id' => ID::custom('metadata'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 16384, // https://tools.ietf.org/html/rfc4288#section-4.2 + 'size' => 75000, // https://tools.ietf.org/html/rfc4288#section-4.2 'signed' => true, 'required' => false, 'default' => null, diff --git a/src/Appwrite/Migration/Version/V21.php b/src/Appwrite/Migration/Version/V21.php index 7dd2912234..0e7a8b78db 100644 --- a/src/Appwrite/Migration/Version/V21.php +++ b/src/Appwrite/Migration/Version/V21.php @@ -36,6 +36,11 @@ class V21 extends Migration Console::info('Migrating Documents'); $this->forEachDocument([$this, 'fixDocument']); + + if ($this->project->getInternalId() !== 'console') { + Console::info('Migrating Buckets'); + $this->migrateBuckets(); + } } /** @@ -177,4 +182,20 @@ class V21 extends Migration return $document; } + + /** + * Migrating Buckets. + * + * @return void + * @throws Exception + * @throws PDOException + */ + private function migrateBuckets() + { + foreach ($this->documentsIterator('buckets') as $bucket) { + $bucketId = 'bucket_' . $bucket['$internalId']; + + $this->projectDB->updateAttribute($bucketId, 'metadata', size: 75000); + } + } }