mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Merge pull request #8452 from appwrite/fix-buckets-metadata
fix: Increasing buckets metadata
This commit is contained in:
commit
6d7fe6e28d
2 changed files with 25 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ class V21 extends Migration
|
|||
Console::info('Migrating Collections');
|
||||
$this->migrateCollections();
|
||||
|
||||
if ($this->project->getInternalId() !== 'console') {
|
||||
Console::info('Migrating Buckets');
|
||||
$this->migrateBuckets();
|
||||
}
|
||||
|
||||
Console::info('Migrating Documents');
|
||||
$this->forEachDocument([$this, 'fixDocument']);
|
||||
}
|
||||
|
|
@ -177,4 +182,23 @@ class V21 extends Migration
|
|||
|
||||
return $document;
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrating Buckets.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function migrateBuckets()
|
||||
{
|
||||
foreach ($this->documentsIterator('buckets') as $bucket) {
|
||||
$bucketId = 'bucket_' . $bucket['$internalId'];
|
||||
|
||||
try {
|
||||
$this->projectDB->updateAttribute($bucketId, 'metadata', size: 75000);
|
||||
$this->projectDB->purgeCachedCollection($bucketId);
|
||||
} catch (\Throwable $th) {
|
||||
Console::warning("'bucketId' from {$bucketId}: {$th->getMessage()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue