fixed bug in DB upgrade procedure
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 28 Apr 2017 14:28:16 +0000 (17:28 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 28 Apr 2017 14:28:25 +0000 (17:28 +0300)
include/netxmsdb.h
src/server/tools/nxdbmgr/upgrade.cpp

index 68147be..a2217f8 100644 (file)
@@ -23,6 +23,6 @@
 #ifndef _netxmsdb_h
 #define _netxmsdb_h
 
-#define DB_FORMAT_VERSION   447
+#define DB_FORMAT_VERSION   448
 
 #endif
index 3a0df4a..b55d165 100644 (file)
@@ -746,6 +746,16 @@ static bool SetSchemaVersion(int version)
    return SQLQuery(query);
 }
 
+/**
+ * Upgrade from V447 to V448
+ */
+static BOOL H_UpgradeFromV447(int currVersion, int newVersion)
+{
+   CHK_EXEC(SQLQuery(_T("ALTER TABLE nodes ADD lldp_id varchar(63)")));
+   CHK_EXEC(SetSchemaVersion(448));
+   return TRUE;
+}
+
 /**
  * Upgrade from V446 to V447
  */
@@ -11679,6 +11689,7 @@ static struct
    { 444, 445, H_UpgradeFromV444 },
    { 445, 446, H_UpgradeFromV445 },
    { 446, 447, H_UpgradeFromV446 },
+   { 447, 448, H_UpgradeFromV447 },
    { 0, 0, NULL }
 };