From: Somin Kim Date: Mon, 20 Jun 2016 06:33:23 +0000 (+0900) Subject: Modified custom table, column name as camel case X-Git-Tag: submit/tizen/20160622.045445^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F75504%2F1;p=platform%2Fcore%2Fcontext%2Fcontext-provider.git Modified custom table, column name as camel case Change-Id: Ifbab3383b3eb0580e8c993fea2af1075f7a6b24b Signed-off-by: Somin Kim --- diff --git a/src/custom/CustomManager.cpp b/src/custom/CustomManager.cpp index 8c01a4b..1f47c13 100644 --- a/src/custom/CustomManager.cpp +++ b/src/custom/CustomManager.cpp @@ -111,7 +111,7 @@ bool CustomManager::__initialize() IF_FAIL_RETURN_TAG(ret, false, _E, "Create template table failed"); /* Register custom items */ - std::string qSelect = "SELECT * FROM context_trigger_custom_template"; + std::string qSelect = "SELECT * FROM ContextTriggerCustomTemplate"; ret = __dbManager.executeSync(qSelect.c_str(), &record); IF_FAIL_RETURN_TAG(ret, false, _E, "Failed to query custom templates"); IF_FAIL_RETURN(record.size() > 0, true); @@ -161,7 +161,7 @@ int CustomManager::__addCustomItem(std::string subject, std::string name, Json t /* Insert item to custom template db */ if (!isInit) { - std::string q = "INSERT OR IGNORE INTO context_trigger_custom_template (subject, name, attributes, owner) VALUES ('" + std::string q = "INSERT OR IGNORE INTO ContextTriggerCustomTemplate (subject, name, attributes, owner) VALUES ('" + subject + "', '" + name + "', '" + tmpl.str() + "', '" + owner + "'); "; std::vector record; bool ret = __dbManager.executeSync(q.c_str(), &record); @@ -182,7 +182,7 @@ int CustomManager::__removeCustomItem(std::string subject) __customMap.erase(it); /* Delete item from custom template db */ - std::string q = "DELETE FROM context_trigger_custom_template WHERE subject = '" + subject + "'"; + std::string q = "DELETE FROM ContextTriggerCustomTemplate WHERE subject = '" + subject + "'"; std::vector record; bool ret = __dbManager.executeSync(q.c_str(), &record); IF_FAIL_RETURN_TAG(ret, ERR_OPERATION_FAILED, _E, "Failed to query custom templates"); diff --git a/src/custom/CustomTypes.h b/src/custom/CustomTypes.h index 797be6c..8aecdfa 100644 --- a/src/custom/CustomTypes.h +++ b/src/custom/CustomTypes.h @@ -33,10 +33,8 @@ #define CUSTOM_SEPERATOR "/" -#define MEDIA_TABLE_NAME "Log_MediaPlayback" - #define CUSTOM_TEMPLATE_TABLE_SCHEMA \ - "CREATE TABLE IF NOT EXISTS context_trigger_custom_template " \ + "CREATE TABLE IF NOT EXISTS ContextTriggerCustomTemplate " \ "(subject TEXT DEFAULT '' NOT NULL PRIMARY KEY, name TEXT DEFAULT '' NOT NULL," \ " operation INTEGER DEFAULT 3 NOT NULL, attributes TEXT DEFAULT '' NOT NULL, " \ " owner TEXT DEFAULT '' NOT NULL)"