From: SukhyungKang Date: Tue, 7 Nov 2023 07:20:01 +0000 (+0900) Subject: Update script to add database version X-Git-Tag: accepted/tizen/unified/20231114.041317~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fde89c6665b2dca50c05ca0fbdf83c4ce6fae30c;p=platform%2Fcore%2Fapi%2Fnotification.git Update script to add database version Change-Id: I6fc568d64b2a67b4ebe2535b8a0fae54ca8b1c7d Signed-off-by: SukhyungKang --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c07856c1..e5e2ab98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,3 +9,9 @@ ENABLE_TESTING() SET(NOTIFICATION_UNIT_TESTS notification-unittests) ADD_TEST(NAME ${NOTIFICATION_UNIT_TESTS} COMMAND ${NOTIFICATION_UNIT_TESTS}) ADD_DEPENDENCIES(${NOTIFICATION_UNIT_TESTS} notification) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/scripts/505.notification_upgrade.sh.in 505.notification_upgrade.sh @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/505.notification_upgrade.sh DESTINATION /usr/share/upgrade/scripts/) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/scripts/505.notification_upgrade.sh.in upgrade.sh @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade.sh DESTINATION /etc/notification/) diff --git a/packaging/notification.spec b/packaging/notification.spec index 78087d91..5f08cd74 100644 --- a/packaging/notification.spec +++ b/packaging/notification.spec @@ -121,9 +121,6 @@ mkdir -p %{buildroot}%{_bindir}/tizen-unittests/%{name} install -m 0755 run-unittest.sh %{buildroot}%{_bindir}/tizen-unittests/%{name}/ sed -i -e 's//notification/g' %{buildroot}%{_bindir}/tizen-unittests/%{name}/run-unittest.sh -mkdir -p %{buildroot}%{upgrade_script_path} -cp -f scripts/505.notification_upgrade.sh %{buildroot}%{upgrade_script_path} - %clean rm -rf %{buildroot} @@ -146,6 +143,7 @@ fi %{_bindir}/notification_init %attr(0755,root,root) %{upgrade_script_path}/505.notification_upgrade.sh #%{_bindir}/notification-test-app +%attr(0755,root,root) /etc/notification/upgrade.sh %files devel %defattr(-,root,root,-) diff --git a/scripts/505.notification_upgrade.sh b/scripts/505.notification_upgrade.sh deleted file mode 100644 index 95ed350a..00000000 --- a/scripts/505.notification_upgrade.sh +++ /dev/null @@ -1,244 +0,0 @@ -#!/bin/sh - -#----------------------------------------------------# -# notification patch for upgrade (7.0 -> 8.0) # -#----------------------------------------------------# - -# Macro -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -DB_DIR=/opt/dbspace -DB_NOTIFICATION=$DB_DIR/.notification.db - -CheckListTable() { - ADDED_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_list)' | grep b_event_handler_click_on_button_7` - - CHECKBOX_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_list)' | grep check_box` - - echo "## Check list table" - - if [ -z "${ADDED_COLUMN}" ] || [ -z "${CHECKBOX_COLUMN}"]; then - echo "column empty" - return 1 - else - echo "column exist" - return 0 - fi -} - -CheckTemplateTable() { - ADDED_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_template)' | grep template_name` - - CHECKBOX_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_template)' | grep check_box` - - echo "## Check template table" - - if [ -z "${ADDED_COLUMN}" ] || [ -z "${CHECKBOX_COLUMN}"]; then - echo "column empty" - return 1 - else - echo "column exist" - return 0 - fi -} - -UpdateListTable() { -sqlite3 $DB_NOTIFICATION << EOF - -DROP TABLE IF EXISTS noti_list_temp; -CREATE TABLE noti_list_temp ( - type INTEGER NOT NULL, - layout INTEGER NOT NULL default 0, - pkg_id TEXT NOT NULL, - caller_app_id TEXT NOT NULL, - launch_app_id TEXT, - app_label TEXT, - image_path TEXT, - priv_image_path TEXT, - group_id INTEGER default 0, - internal_group_id INTEGER default 0, - priv_id INTEGER PRIMARY KEY AUTOINCREMENT, - 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, - b_event_handler_click_on_text_input_button TEXT, - b_event_handler_click_on_button_7 TEXT, - b_event_handler_click_on_button_8 TEXT, - b_event_handler_click_on_button_9 TEXT, - b_event_handler_click_on_button_10 TEXT, - sound_type INTEGER default 0, - sound_path TEXT, - priv_sound_path TEXT, - vibration_type INTEGER default 0, - vibration_path TEXT, - priv_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, - ongoing_flag INTEGER default 0, - ongoing_value_type INTEGER default 0, - ongoing_current INTEGER default 0, - ongoing_duration INTEGER default 0, - auto_remove INTEGER default 1, - default_button_index INTEGER default 0, - hide_timeout INTEGER default 0, - delete_timeout INTEGER default 0, - text_input_max_length INTEGER default 0, - event_flag INTEGER default 0, - extension_image_size INTEGER default 0, - uid INTEGER, - check_box INTEGER DEFAULT 0, - check_box_value INTEGER DEFAULT 0 -); -INSERT INTO noti_list_temp (type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid) \ -SELECT type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid FROM noti_list; -DROP TABLE noti_list; -ALTER TABLE noti_list_temp RENAME TO noti_list; -EOF -} - -UpdateTemplateTable() { -sqlite3 $DB_NOTIFICATION << EOF - -DROP TABLE IF EXISTS noti_template_temp; -CREATE TABLE noti_template_temp ( - type INTEGER NOT NULL, - layout INTEGER NOT NULL default 0, - pkg_id TEXT NOT NULL, - caller_app_id TEXT NOT NULL, - launch_app_id TEXT, - app_label TEXT, - image_path TEXT, - priv_image_path TEXT, - group_id INTEGER default 0, - internal_group_id INTEGER default 0, - priv_id INTEGER PRIMARY KEY AUTOINCREMENT, - 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, - b_event_handler_click_on_text_input_button TEXT, - b_event_handler_click_on_button_7 TEXT, - b_event_handler_click_on_button_8 TEXT, - b_event_handler_click_on_button_9 TEXT, - b_event_handler_click_on_button_10 TEXT, - sound_type INTEGER default 0, - sound_path TEXT, - priv_sound_path TEXT, - vibration_type INTEGER default 0, - vibration_path TEXT, - priv_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, - ongoing_flag INTEGER default 0, - ongoing_value_type INTEGER default 0, - ongoing_current INTEGER default 0, - ongoing_duration INTEGER default 0, - auto_remove INTEGER default 1, - default_button_index INTEGER default 0, - hide_timeout INTEGER default 0, - delete_timeout INTEGER default 0, - text_input_max_length INTEGER default 0, - event_flag INTEGER default 0, - extension_image_size INTEGER default 0, - uid INTEGER, - check_box INTEGER DEFAULT 0, - check_box_value INTEGER DEFAULT 0, - template_name TEXT, - UNIQUE (caller_app_id, template_name) -); -INSERT INTO noti_template_temp (type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid) \ -SELECT type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid FROM noti_template; -DROP TABLE noti_template; -ALTER TABLE noti_template_temp RENAME TO noti_template; -EOF -} - -UpdatePermission() { - -chown app_fw:app_fw $DB_NOTIFICATION -chown app_fw:app_fw $DB_NOTIFICATION-journal - -chsmack -a System $DB_NOTIFICATION -chsmack -a System $DB_NOTIFICATION-journal -} - -UpdateNotiDB() { - echo "## Update noti DB" - - CheckListTable - RESULT=$? - if [ ${RESULT} == 1 ]; then - UpdateListTable - echo "update list table" - else - echo "list table already updated" - fi - - CheckTemplateTable - RESULT=$? - if [ ${RESULT} == 1 ]; then - UpdateTemplateTable - echo "update template table" - else - echo "template table already updated" - fi - - UpdatePermission -} - -UpdateNotiDB diff --git a/scripts/505.notification_upgrade.sh.in b/scripts/505.notification_upgrade.sh.in new file mode 100644 index 00000000..57541a0d --- /dev/null +++ b/scripts/505.notification_upgrade.sh.in @@ -0,0 +1,257 @@ +#!/bin/sh + +#----------------------------------------------------# +# notification patch for upgrade (7.0 -> 8.0) # +#----------------------------------------------------# + +# Macro +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +DB_DIR=/opt/dbspace +DB_NOTIFICATION=$DB_DIR/.notification.db +DB_VERSION=1 + +CheckListTable() { + ADDED_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_list)' | grep b_event_handler_click_on_button_7` + + CHECKBOX_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_list)' | grep check_box` + + CURRENT_VERSION=`sqlite3 $DB_NOTIFICATION 'PRAGMA user_version'` + + echo "## Check list table" + + if [ -z "${ADDED_COLUMN}" ] || [ -z "${CHECKBOX_COLUMN}" ] || [ ${CURRENT_VERSION} -ne ${DB_VERSION} ]; then + echo "column empty" + return 1 + else + echo "column exist" + return 0 + fi +} + +CheckTemplateTable() { + ADDED_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_template)' | grep template_name` + + CHECKBOX_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_template)' | grep check_box` + + CURRENT_VERSION=`sqlite3 $DB_NOTIFICATION 'PRAGMA user_version'` + + echo "## Check template table" + + if [ -z "${ADDED_COLUMN}" ] || [ -z "${CHECKBOX_COLUMN}" ] || [ ${CURRENT_VERSION} -ne ${DB_VERSION} ]; then + echo "column empty" + return 1 + else + echo "column exist" + return 0 + fi +} + +UpdateDBVersion() { +sqlite3 $DB_NOTIFICATION << EOF + +PRAGMA user_version = ${DB_VERSION}; +EOF +} + +UpdateListTable() { +sqlite3 $DB_NOTIFICATION << EOF + +DROP TABLE IF EXISTS noti_list_temp; +CREATE TABLE noti_list_temp ( + type INTEGER NOT NULL, + layout INTEGER NOT NULL default 0, + pkg_id TEXT NOT NULL, + caller_app_id TEXT NOT NULL, + launch_app_id TEXT, + app_label TEXT, + image_path TEXT, + priv_image_path TEXT, + group_id INTEGER default 0, + internal_group_id INTEGER default 0, + priv_id INTEGER PRIMARY KEY AUTOINCREMENT, + 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, + b_event_handler_click_on_text_input_button TEXT, + b_event_handler_click_on_button_7 TEXT, + b_event_handler_click_on_button_8 TEXT, + b_event_handler_click_on_button_9 TEXT, + b_event_handler_click_on_button_10 TEXT, + sound_type INTEGER default 0, + sound_path TEXT, + priv_sound_path TEXT, + vibration_type INTEGER default 0, + vibration_path TEXT, + priv_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, + ongoing_flag INTEGER default 0, + ongoing_value_type INTEGER default 0, + ongoing_current INTEGER default 0, + ongoing_duration INTEGER default 0, + auto_remove INTEGER default 1, + default_button_index INTEGER default 0, + hide_timeout INTEGER default 0, + delete_timeout INTEGER default 0, + text_input_max_length INTEGER default 0, + event_flag INTEGER default 0, + extension_image_size INTEGER default 0, + uid INTEGER, + check_box INTEGER DEFAULT 0, + check_box_value INTEGER DEFAULT 0 +); +INSERT INTO noti_list_temp (type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid) \ +SELECT type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid FROM noti_list; +DROP TABLE noti_list; +ALTER TABLE noti_list_temp RENAME TO noti_list; +EOF +} + +UpdateTemplateTable() { +sqlite3 $DB_NOTIFICATION << EOF + +DROP TABLE IF EXISTS noti_template_temp; +CREATE TABLE noti_template_temp ( + type INTEGER NOT NULL, + layout INTEGER NOT NULL default 0, + pkg_id TEXT NOT NULL, + caller_app_id TEXT NOT NULL, + launch_app_id TEXT, + app_label TEXT, + image_path TEXT, + priv_image_path TEXT, + group_id INTEGER default 0, + internal_group_id INTEGER default 0, + priv_id INTEGER PRIMARY KEY AUTOINCREMENT, + 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, + b_event_handler_click_on_text_input_button TEXT, + b_event_handler_click_on_button_7 TEXT, + b_event_handler_click_on_button_8 TEXT, + b_event_handler_click_on_button_9 TEXT, + b_event_handler_click_on_button_10 TEXT, + sound_type INTEGER default 0, + sound_path TEXT, + priv_sound_path TEXT, + vibration_type INTEGER default 0, + vibration_path TEXT, + priv_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, + ongoing_flag INTEGER default 0, + ongoing_value_type INTEGER default 0, + ongoing_current INTEGER default 0, + ongoing_duration INTEGER default 0, + auto_remove INTEGER default 1, + default_button_index INTEGER default 0, + hide_timeout INTEGER default 0, + delete_timeout INTEGER default 0, + text_input_max_length INTEGER default 0, + event_flag INTEGER default 0, + extension_image_size INTEGER default 0, + uid INTEGER, + check_box INTEGER DEFAULT 0, + check_box_value INTEGER DEFAULT 0, + template_name TEXT, + UNIQUE (caller_app_id, template_name) +); +INSERT INTO noti_template_temp (type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid) \ +SELECT type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, auto_remove, default_button_index, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid FROM noti_template; +DROP TABLE noti_template; +ALTER TABLE noti_template_temp RENAME TO noti_template; +EOF +} + +UpdatePermission() { + +chown app_fw:app_fw $DB_NOTIFICATION +chown app_fw:app_fw $DB_NOTIFICATION-journal + +chsmack -a System $DB_NOTIFICATION +chsmack -a System $DB_NOTIFICATION-journal +} + +UpdateNotiDB() { + echo "## Update noti DB" + + CheckListTable + RESULT=$? + if [ ${RESULT} == 1 ]; then + UpdateListTable + UpdateDBVersion + echo "update list table" + else + echo "list table already updated" + fi + + CheckTemplateTable + RESULT=$? + if [ ${RESULT} == 1 ]; then + UpdateTemplateTable + echo "update template table" + else + echo "template table already updated" + fi + + UpdatePermission +} + +UpdateNotiDB