Modified custom table, column name as camel case 04/75504/1
authorSomin Kim <somin926.kim@samsung.com>
Mon, 20 Jun 2016 06:33:23 +0000 (15:33 +0900)
committerSomin Kim <somin926.kim@samsung.com>
Mon, 20 Jun 2016 06:33:23 +0000 (15:33 +0900)
Change-Id: Ifbab3383b3eb0580e8c993fea2af1075f7a6b24b
Signed-off-by: Somin Kim <somin926.kim@samsung.com>
src/custom/CustomManager.cpp
src/custom/CustomTypes.h

index 8c01a4b..1f47c13 100644 (file)
@@ -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<Json> 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<Json> record;
        bool ret = __dbManager.executeSync(q.c_str(), &record);
        IF_FAIL_RETURN_TAG(ret, ERR_OPERATION_FAILED, _E, "Failed to query custom templates");
index 797be6c..8aecdfa 100644 (file)
 
 #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)"