From 27a96a40db9d165f57ef64f09a2a7ef572ab58c2 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 10 Aug 2010 02:32:50 -0400
Subject: [PATCH] - Fix path to SQL files when using pgsql/mysqli/sqlsrv drivers (#1486902)

---
 bin/update.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/update.sh b/bin/update.sh
index 7a4d1cf..2d59b26 100755
--- a/bin/update.sh
+++ b/bin/update.sh
@@ -114,7 +114,8 @@
       $success = false;
     }
     else if ($RCI->db_schema_check($DB, false)) {
-      $updatefile = INSTALL_PATH . 'SQL/' . $DB->db_provider . '.update.sql';
+      $db_map = array('pgsql' => 'postgres', 'mysqli' => 'mysql', 'sqlsrv' => 'mssql');
+      $updatefile = INSTALL_PATH . 'SQL/' . (isset($db_map[$DB->db_provider]) ? $db_map[$DB->db_provider] : $DB->db_provider) . '.update.sql';
       echo "WARNING: Database schema needs to be updated!\n";
       echo "Open $updatefile and execute all queries that are superscribed with the currently installed version number\n";
       $success = false;

--
Gitblit v1.9.1