浏览代码

Renamed priv_Userinternal into priv_userinternal: the upgrade must be idempotent!

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2436 a333f486-631f-4898-b8df-5754b55c2be0
romainq 12 年之前
父节点
当前提交
7c5d0f8d9f
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      setup/applicationinstaller.class.inc.php

+ 9 - 2
setup/applicationinstaller.class.inc.php

@@ -542,9 +542,16 @@ class ApplicationInstaller
 			SetupPage::log_info("Renaming 'priv_internalUser' into 'priv_internaluser' (lowercase)"); 
 			// This command will have no effect under Windows...
 			// and it has been written in two steps so as to make it work under windows!
-			$sRepair = "RENAME TABLE `priv_internalUser` TO `priv_internaluser_other`, `priv_internaluser_other` TO `priv_internaluser`";
 			CMDBSource::SelectDB($sDBName);
-			CMDBSource::Query($sRepair);
+			try
+			{
+				$sRepair = "RENAME TABLE `priv_internalUser` TO `priv_internaluser_other`, `priv_internaluser_other` TO `priv_internaluser`";
+				CMDBSource::Query($sRepair);
+			}
+			catch (Exception $e)
+			{
+				SetupPage::log_info("Renaming 'priv_internalUser' failed (already done in a previous upgrade?)"); 
+			}
 		}
 
 		// Module specific actions (migrate the data)