From 124cb721b81f3dfcd80ba038302fe40cebac08e4 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Thu, 7 Mar 2024 17:21:19 +0100 Subject: [PATCH] sync: 1.5.x --- src/Appwrite/Migration/Version/V20.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Appwrite/Migration/Version/V20.php b/src/Appwrite/Migration/Version/V20.php index 7a848734dd..4f547b9234 100644 --- a/src/Appwrite/Migration/Version/V20.php +++ b/src/Appwrite/Migration/Version/V20.php @@ -142,6 +142,29 @@ class V20 extends Migration $this->createCollection('challenges'); $this->createCollection('authenticators'); + break; + + case 'cache': + + // Create resourceType attribute + try { + $this->createAttributeFromCollection($this->projectDB, $id, 'resourceType'); + } catch (Throwable $th) { + Console::warning("'resourceType' from {$id}: {$th->getMessage()}"); + } + + // Create mimeType attribute + try { + $this->createAttributeFromCollection($this->projectDB, $id, 'mimeType'); + } catch (Throwable $th) { + Console::warning("'mimeType' from {$id}: {$th->getMessage()}"); + } + try { + $this->projectDB->purgeCachedCollection($id); + } catch (Throwable $th) { + Console::warning("Purge cache from {$id}: {$th->getMessage()}"); + } + break; case 'stats': try {