From 8387aa5cf6d5b05d0867666093be33fbbba1812d Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Fri, 5 Aug 2016 11:21:18 +0900 Subject: [PATCH] Fix unexpected unique constraint on package_app_splash_screen - operation column will be part of primary key of package_app_splash_screen Change-Id: I6a128c89586e513ae4f224709a04aa2e154eac2f Signed-off-by: Junghyun Yeon --- parser/pkgmgr_parser_db.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser/pkgmgr_parser_db.c b/parser/pkgmgr_parser_db.c index a95bcbe..434c778 100644 --- a/parser/pkgmgr_parser_db.c +++ b/parser/pkgmgr_parser_db.c @@ -298,7 +298,7 @@ sqlite3 *pkgmgr_cert_db; "indicatordisplay TEXT, " \ "operation TEXT, " \ "color_depth TEXT NOT NULL DEFAULT '24', " \ - "PRIMARY KEY(app_id, orientation) " \ + "PRIMARY KEY(app_id, orientation, operation) " \ "FOREIGN KEY(app_id) " \ "REFERENCES package_app_info(app_id) " \ "ON DELETE CASCADE)" @@ -1679,11 +1679,13 @@ static int __insert_application_splashscreen_info(manifest_x *mfx) ss = (splashscreen_x *)tmp->data; sqlite3_snprintf(MAX_QUERY_LEN, query, "INSERT INTO package_app_splash_screen" \ - "(app_id, src, type, orientation, indicatordisplay, operation, color_depth) " \ + "(app_id, src, type, orientation, indicatordisplay, " \ + "operation, color_depth) " \ "VALUES(%Q, %Q, %Q, %Q, %Q, %Q, %Q)", app->appid, ss->src, ss->type, ss->orientation, ss->indicatordisplay, ss->operation, ss->color_depth); + ret = __exec_query(query); if (ret == -1) { _LOGD("Package UiApp Splash Screen DB Insert Failed"); -- 2.7.4