From 7848f76f982a997662a82b9475c4a54f145eb474 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 2 Mar 2022 08:42:34 +0100 Subject: [PATCH] fix: teams total sum renaming --- src/Appwrite/Migration/Version/V12.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Migration/Version/V12.php b/src/Appwrite/Migration/Version/V12.php index 3d56f36355..ac7d3aef8a 100644 --- a/src/Appwrite/Migration/Version/V12.php +++ b/src/Appwrite/Migration/Version/V12.php @@ -213,6 +213,18 @@ class V12 extends Migration */ $this->createCollection('builds'); + break; + + case 'functions': + try { + /** + * Rename tag to deployment + */ + $this->projectDB->renameAttribute($id, 'sum', 'total'); + } catch (\Throwable $th) { + Console::warning("'total' from {$id}: {$th->getMessage()}"); + } + break; } usleep(100000); @@ -495,13 +507,6 @@ class V12 extends Migration break; case 'teams': - /** - * Rename sum to total - */ - if (empty($document->getAttribute('total'))) { - $document->setAttribute('total', $document->getAttribute('sum')); - } - /** * Populate search string from Migration to 0.12. */