From ef0954cdda55b2fff96a9cd21054454670397b97 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 20 Mar 2026 21:56:06 +1300 Subject: [PATCH] fix: propagate isUpgrade flag from Upgrade to Install for CLI path Install::action() hardcoded isUpgrade=false, so the CLI upgrade path never rewrote compose/env files. Added a protected property that Upgrade sets before calling parent::action(). Co-Authored-By: Claude Opus 4.6 (1M context) --- src/Appwrite/Platform/Tasks/Install.php | 3 ++- src/Appwrite/Platform/Tasks/Upgrade.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/Install.php b/src/Appwrite/Platform/Tasks/Install.php index d88f50efe6..af768444f2 100644 --- a/src/Appwrite/Platform/Tasks/Install.php +++ b/src/Appwrite/Platform/Tasks/Install.php @@ -33,6 +33,7 @@ class Install extends Action private const string APPWRITE_API_URL = 'http://appwrite'; private const string GROWTH_API_URL = 'https://growth.appwrite.io/v1'; + protected bool $isUpgrade = false; protected string $hostPath = ''; protected ?bool $isLocalInstall = null; protected ?array $installerConfig = null; @@ -66,7 +67,7 @@ class Install extends Action bool $noStart, string $database ): void { - $isUpgrade = false; + $isUpgrade = $this->isUpgrade; $defaultHttpPort = '80'; $defaultHttpsPort = '443'; $config = Config::getParam('variables'); diff --git a/src/Appwrite/Platform/Tasks/Upgrade.php b/src/Appwrite/Platform/Tasks/Upgrade.php index 960f10f3e6..1d61180963 100644 --- a/src/Appwrite/Platform/Tasks/Upgrade.php +++ b/src/Appwrite/Platform/Tasks/Upgrade.php @@ -42,6 +42,7 @@ class Upgrade extends Install bool $noStart, string $database ): void { + $this->isUpgrade = true; $isLocalInstall = $this->isLocalInstall(); $this->applyLocalPaths($isLocalInstall, true);