From 8256c8b29488649a5c90caffbd721aa8a07103d3 Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 12 Feb 2024 17:22:33 +0200 Subject: [PATCH] cache collection attr migration --- src/Appwrite/Migration/Version/V20.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Appwrite/Migration/Version/V20.php b/src/Appwrite/Migration/Version/V20.php index 505fc3a7fd..6747c96f1e 100644 --- a/src/Appwrite/Migration/Version/V20.php +++ b/src/Appwrite/Migration/Version/V20.php @@ -129,6 +129,24 @@ class V20 extends Migration $this->createCollection('targets'); $this->createCollection('challenges'); + break; + case 'cache': + // Create resourceType attribute + try { + $this->createAttributeFromCollection($this->projectDB, $id, 'resourceType'); + $this->projectDB->purgeCachedCollection($id); + } catch (Throwable $th) { + Console::warning("'resourceType' from {$id}: {$th->getMessage()}"); + } + + // Create mimeType attribute + try { + $this->createAttributeFromCollection($this->projectDB, $id, 'mimeType'); + $this->projectDB->purgeCachedCollection($id); + } catch (Throwable $th) { + Console::warning("'mimeType' from {$id}: {$th->getMessage()}"); + } + break; case 'stats': try {