#include "MsgPluginManager.h"
#include "MsgStorageHandler.h"
-#define MSG_DB_VERSION 1
+#define MSG_DB_VERSION 2
/*==================================================================================================
VARIABLES
}
+void MsgUpdateDBtoVer2()
+{
+ MsgDbHandler *dbHandle = getDbHandle();
+ msg_error_t err = MSG_SUCCESS;
+ char sqlQuery[MAX_QUERY_LEN+1] = {0};
+ snprintf(sqlQuery, sizeof(sqlQuery),
+ "ALTER TABLE %s "
+ "ADD (DPM_RESTRICTED INTEGER DEFAULT 0);",
+ MSGFW_MESSAGE_TABLE_NAME);
+
+ err = dbHandle->execQuery(sqlQuery);
+
+ if (err == MSG_SUCCESS)
+ MSG_SEC_DEBUG("SUCCESS : alter %s.", MSGFW_MESSAGE_TABLE_NAME);
+ else
+ MSG_SEC_DEBUG("FAIL : create %s [%d].", MSGFW_MESSAGE_TABLE_NAME, err);
+}
+
+
void MsgStoUpdateDBVersion()
{
MsgDbHandler *dbHandle = getDbHandle();
case 0 :
MsgUpdateDBtoVer1();
/* no break */
+ case 1 :
+ MsgUpdateDBtoVer2();
+ /* no break */
default :
MsgStoUpdateDBVersion();
/* no break */