From 1db6a43b346a92dbf61a2e35c6cb3b27d38c4ebc Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 24 Jun 2026 13:08:30 +0530 Subject: [PATCH] Restore PostgreSQL installer defaults --- app/views/install/installer.phtml | 2 +- app/views/install/installer/js/modules/context.js | 4 ++-- app/views/install/installer/templates/steps/step-1.phtml | 2 +- src/Appwrite/Platform/Installer/Runtime/Config.php | 2 +- src/Appwrite/Platform/Tasks/Install.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/install/installer.phtml b/app/views/install/installer.phtml index d5e4383f48..2de92fd3f3 100644 --- a/app/views/install/installer.phtml +++ b/app/views/install/installer.phtml @@ -9,7 +9,7 @@ $defaultAppDomain = ($defaultAppDomain === 'traefik') ? 'localhost' : $defaultAp $defaultEmailCertificates ??= ''; $defaultDatabase = $vars['_APP_DB_ADAPTER']['default'] ?? 'mongodb'; $lockedDatabase = $isUpgrade && empty($lockedDatabase) ? $defaultDatabase : $lockedDatabase; -$enabledDatabases ??= ['mongodb', 'mariadb']; +$enabledDatabases ??= ['mongodb', 'mariadb', 'postgresql']; $isLocalInstall ??= false; diff --git a/app/views/install/installer/js/modules/context.js b/app/views/install/installer/js/modules/context.js index 36b85a3843..6f215da899 100644 --- a/app/views/install/installer/js/modules/context.js +++ b/app/views/install/installer/js/modules/context.js @@ -4,8 +4,8 @@ const getLockedDatabase = () => getBodyDataset().lockedDatabase || ''; const getEnabledDatabases = () => { const raw = getBodyDataset().enabledDatabases; - if (!raw) return ['mongodb', 'mariadb']; - try { return JSON.parse(raw); } catch (e) { return ['mongodb', 'mariadb']; } + if (!raw) return ['mongodb', 'mariadb', 'postgresql']; + try { return JSON.parse(raw); } catch (e) { return ['mongodb', 'mariadb', 'postgresql']; } }; const STEP_IDS = Object.freeze({ diff --git a/app/views/install/installer/templates/steps/step-1.phtml b/app/views/install/installer/templates/steps/step-1.phtml index e7d356745b..cfd02819bb 100644 --- a/app/views/install/installer/templates/steps/step-1.phtml +++ b/app/views/install/installer/templates/steps/step-1.phtml @@ -7,7 +7,7 @@ $defaultHttpsPort ??= '443'; $defaultEmailCertificates ??= ''; $defaultAssistantOpenAIKey ??= ''; $defaultDatabase ??= 'mongodb'; -$enabledDatabases ??= ['mongodb', 'mariadb']; +$enabledDatabases ??= ['mongodb', 'mariadb', 'postgresql']; $selectedDatabase = $lockedDatabase ?: $defaultDatabase; $isDatabaseLocked = !empty($lockedDatabase); $mongoEnabled = in_array('mongodb', $enabledDatabases, true); diff --git a/src/Appwrite/Platform/Installer/Runtime/Config.php b/src/Appwrite/Platform/Installer/Runtime/Config.php index 6142e47152..53479a00f0 100644 --- a/src/Appwrite/Platform/Installer/Runtime/Config.php +++ b/src/Appwrite/Platform/Installer/Runtime/Config.php @@ -27,7 +27,7 @@ final class Config private bool $isLocal = false; private ?string $hostPath = null; private ?string $lockedDatabase = null; - private array $enabledDatabases = ['mongodb', 'mariadb']; + private array $enabledDatabases = ['mongodb', 'mariadb', 'postgresql']; private array $vars = []; public function __construct(array $values = []) diff --git a/src/Appwrite/Platform/Tasks/Install.php b/src/Appwrite/Platform/Tasks/Install.php index 75f3c5bf18..70a6135901 100644 --- a/src/Appwrite/Platform/Tasks/Install.php +++ b/src/Appwrite/Platform/Tasks/Install.php @@ -199,7 +199,7 @@ class Install extends Action } $installerConfig = $this->readInstallerConfig(); - $enabledDatabases = $installerConfig['enabledDatabases'] ?? ['mongodb', 'mariadb']; + $enabledDatabases = $installerConfig['enabledDatabases'] ?? ['mongodb', 'mariadb', 'postgresql']; if (!in_array($database, $enabledDatabases, true)) { Console::error("Database '{$database}' is not available. Available options: " . implode(', ', $enabledDatabases)); Console::exit(1); @@ -331,7 +331,7 @@ class Install extends Action $state->clearStaleLock(); $installerConfig = $this->readInstallerConfig(); - $enabledDatabases = $installerConfig['enabledDatabases'] ?? ['mongodb', 'mariadb']; + $enabledDatabases = $installerConfig['enabledDatabases'] ?? ['mongodb', 'mariadb', 'postgresql']; $this->setInstallerConfig([ 'defaultHttpPort' => $defaultHttpPort,