Fix 'frequency' statistics for the trigger to emit proper results
[platform/core/context/statistics-context-provider.git] / src / app / app_stats_types.h
index 88b1313..4a72864 100644 (file)
@@ -38,9 +38,9 @@
        "UTC TIMESTAMP DEFAULT (strftime('%s', 'now')), " \
        "LocalTime TIMESTAMP DEFAULT (strftime('%s', 'now', 'localtime'))"
 
-#define APP_VIEW_USAGE_FREQ            "View_AppLaunchFreq"
-#define APP_VIEW_USAGE_FREQ_SQL \
-       "CREATE VIEW IF NOT EXISTS " APP_VIEW_USAGE_FREQ " AS " \
-       "SELECT AppId, COUNT(*) AS TotalCount FROM " APP_TABLE_USAGE_LOG " GROUP BY AppId"
+#define APP_TEMP_USAGE_FREQ            "Temp_AppLaunchFreq"
+#define APP_TEMP_USAGE_FREQ_SQL \
+       "CREATE TABLE IF NOT EXISTS " APP_TEMP_USAGE_FREQ \
+       " (AppId TEXT NOT NULL UNIQUE, TotalCount INTEGER DEFAULT 0);"
 
 #endif