Added upgrade procedure to fix incorectly initialized field ldap_unique_id in user_gr...
authorzev <zev@radensolutions.com>
Tue, 19 Jul 2016 14:43:54 +0000 (17:43 +0300)
committerzev <zev@radensolutions.com>
Tue, 19 Jul 2016 14:43:54 +0000 (17:43 +0300)
include/netxmsdb.h
src/server/tools/nxdbmgr/upgrade.cpp

index e60fbfe..e11c070 100644 (file)
@@ -23,6 +23,6 @@
 #ifndef _netxmsdb_h
 #define _netxmsdb_h
 
-#define DB_FORMAT_VERSION   406
+#define DB_FORMAT_VERSION   407
 
 #endif
index 30b8e03..7fc4b38 100644 (file)
@@ -673,6 +673,16 @@ static int NextFreeEPPruleID()
        return ruleId;
 }
 
+/**
+ * Upgrade from V406 to V407
+ */
+static BOOL H_UpgradeFromV406(int currVersion, int newVersion)
+{
+   ResizeColumn(_T("user_groups"), _T("ldap_unique_id"), 64, true);
+   CHK_EXEC(SQLQuery(_T("UPDATE metadata SET var_value='407' WHERE var_name='SchemaVersion'")));
+   return TRUE;
+}
+
 /**
  * Upgrade from V405 to V406
  */
@@ -10250,6 +10260,7 @@ static struct
    { 403, 404, H_UpgradeFromV403 },
    { 404, 405, H_UpgradeFromV404 },
    { 405, 406, H_UpgradeFromV405 },
+   { 406, 407, H_UpgradeFromV406 },
    { 0, 0, NULL }
 };