From f37cf3707f6f4aefb2ff601e5a11239cca19451d Mon Sep 17 00:00:00 2001 From: Hyunho Kang Date: Mon, 9 May 2016 19:13:57 +0900 Subject: Add db create API and remove db create logic from .spec file - data-provider-master will create notification db Change-Id: Ie40657d9bbf3e3e5bd5066af1aa06ee304c6791f Signed-off-by: Hyunho Kang --- packaging/notification.spec | 119 +------------------------------------------- 1 file changed, 1 insertion(+), 118 deletions(-) (limited to 'packaging') diff --git a/packaging/notification.spec b/packaging/notification.spec index b3f12dd..91c32dc 100755 --- a/packaging/notification.spec +++ b/packaging/notification.spec @@ -85,124 +85,6 @@ then mkdir %{TZ_SYS_DB} fi -if [ ! -f %{TZ_SYS_DB}/.notification.db ] -then - sqlite3 %{TZ_SYS_DB}/.notification.db 'PRAGMA journal_mode = PERSIST; - create table if not exists noti_list ( - type INTEGER NOT NULL, - layout INTEGER NOT NULL default 0, - caller_pkgname TEXT NOT NULL, - launch_pkgname TEXT, - image_path TEXT, - group_id INTEGER default 0, - internal_group_id INTEGER default 0, - priv_id INTERGER NOT NULL, - title_key TEXT, - b_text TEXT, - b_key TEXT, - tag TEXT, - b_format_args TEXT, - num_format_args INTEGER default 0, - text_domain TEXT, - text_dir TEXT, - time INTEGER default 0, - insert_time INTEGER default 0, - args TEXT, - group_args TEXT, - b_execute_option TEXT, - b_service_responding TEXT, - b_service_single_launch TEXT, - b_service_multi_launch TEXT, - b_event_handler_click_on_button_1 TEXT, - b_event_handler_click_on_button_2 TEXT, - b_event_handler_click_on_button_3 TEXT, - b_event_handler_click_on_button_4 TEXT, - b_event_handler_click_on_button_5 TEXT, - b_event_handler_click_on_button_6 TEXT, - b_event_handler_click_on_icon TEXT, - b_event_handler_click_on_thumbnail TEXT, - sound_type INTEGER default 0, - sound_path TEXT, - vibration_type INTEGER default 0, - vibration_path TEXT, - led_operation INTEGER default 0, - led_argb INTEGER default 0, - led_on_ms INTEGER default -1, - led_off_ms INTEGER default -1, - flags_for_property INTEGER default 0, - flag_simmode INTEGER default 0, - display_applist INTEGER, - progress_size DOUBLE default 0, - progress_percentage DOUBLE default 0, - rowid INTEGER PRIMARY KEY AUTOINCREMENT, - ongoing_flag INTEGER default 0, - auto_remove INTEGER default 1, - UNIQUE (caller_pkgname, priv_id) - ); - create table if not exists noti_group_data ( - caller_pkgname TEXT NOT NULL, - group_id INTEGER default 0, - badge INTEGER default 0, - title TEXT, - content TEXT, - loc_title TEXT, - loc_content TEXT, - count_display_title INTEGER, - count_display_content INTEGER, - rowid INTEGER PRIMARY KEY AUTOINCREMENT, - UNIQUE (caller_pkgname, group_id) - ); - create table if not exists ongoing_list ( - caller_pkgname TEXT NOT NULL, - launch_pkgname TEXT, - icon_path TEXT, - group_id INTEGER default 0, - internal_group_id INTEGER default 0, - priv_id INTERGER NOT NULL, - title TEXT, - content TEXT, - default_content TEXT, - loc_title TEXT, - loc_content TEXT, - loc_default_content TEXT, - text_domain TEXT, - text_dir TEXT, - args TEXT, - group_args TEXT, - flag INTEGER default 0, - progress_size DOUBLE default 0, - progress_percentage DOUBLE default 0, - rowid INTEGER PRIMARY KEY AUTOINCREMENT, - UNIQUE (caller_pkgname, priv_id) - ); - CREATE TABLE IF NOT EXISTS notification_setting ( - priv_id INTEGER PRIMARY KEY AUTOINCREMENT, - package_name TEXT NOT NULL, - allow_to_notify INTEGER DEFAULT 1, - do_not_disturb_except INTEGER DEFAULT 0, - visibility_class INTEGER DEFAULT 0, - UNIQUE (priv_id, package_name) - ); - CREATE TABLE IF NOT EXISTS notification_system_setting ( - priv_id INTERGER PRIMARY KEY, - do_not_disturb INTEGER DEFAULT 0, - visibility_class INTEGER DEFAULT 0, - UNIQUE (priv_id) - ); - - 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); - ' -else - echo %{TZ_SYS_DB}/.notification.db ": DB file is already exists" -fi - -chown app_fw:app_fw %{TZ_SYS_DB}/.notification.db -chown app_fw:app_fw %{TZ_SYS_DB}/.notification.db-journal -chmod 644 %{TZ_SYS_DB}/.notification.db -chmod 644 %{TZ_SYS_DB}/.notification.db-journal - %postun -p /sbin/ldconfig %files @@ -214,6 +96,7 @@ chmod 644 %{TZ_SYS_DB}/.notification.db-journal %files devel %defattr(-,root,root,-) %{_includedir}/notification/notification.h +%{_includedir}/notification/notification_db.h %{_includedir}/notification/notification_internal.h %{_includedir}/notification/notification_error.h %{_includedir}/notification/notification_type.h -- cgit v1.2.3