From fa3d5f826728f4d1ae3bfb7a0a8a318dddc2a4b1 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 26 Sep 2023 12:33:42 +0300 Subject: [PATCH] sessions --- src/Appwrite/Migration/Version/V20.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Migration/Version/V20.php b/src/Appwrite/Migration/Version/V20.php index 48b511fe41..1272cdfcc2 100644 --- a/src/Appwrite/Migration/Version/V20.php +++ b/src/Appwrite/Migration/Version/V20.php @@ -166,10 +166,11 @@ class V20 extends Migration foreach ($stats as $stat) { var_dump("{$stat['time']}_{$stat['period']}_{$to}"); $id = \md5("{$stat['time']}_{$stat['period']}_{$to}"); + $oldId = $stat->getId(); $stat->setAttribute('$id', $id); $stat->setAttribute('metric', $to); console::log("updating metric {$from} to {$to}"); - $this->projectDB->updateDocument('stats', $stat->getId(), $stat); + $this->projectDB->updateDocument('stats', $oldId, $stat); } $latestDocument = !empty(array_key_last($stats)) ? $stats[array_key_last($stats)] : null;