Fix db init bug 38/69138/2 accepted/tizen/common/20160512.143851 accepted/tizen/ivi/20160512.051124 accepted/tizen/mobile/20160512.051217 accepted/tizen/tv/20160512.051103 accepted/tizen/wearable/20160512.051140 submit/tizen/20160512.021729
authorHyunho Kang <hhstark.kang@samsung.com>
Thu, 12 May 2016 01:36:14 +0000 (10:36 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Thu, 12 May 2016 01:57:42 +0000 (10:57 +0900)
- if table already exists, always return fail

Change-Id: Ife58f0a6240a107eca1752ac5802376d927275bf
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/notification_db.c

index bfa9382..fc73cf4 100755 (executable)
@@ -131,8 +131,8 @@ create      table if not exists noti_list ( \
                        do_not_disturb INTEGER DEFAULT 0, \
                        visibility_class INTEGER DEFAULT 0 \
                ); \
-               INSERT INTO notification_system_setting (priv_id, do_not_disturb, visibility_class) VALUES (0, 0, 0); \
-               CREATE UNIQUE INDEX package_name_idx1 ON notification_setting (package_name);"
+               INSERT OR IGNORE INTO notification_system_setting (priv_id, do_not_disturb, visibility_class) VALUES (0, 0, 0); \
+               CREATE UNIQUE INDEX IF NOT EXISTS package_name_idx1 ON notification_setting (package_name);"
 
 EXPORT_API int notification_db_init()
 {