Add upgrade script to Tizen 4.0 75/143775/1 accepted/tizen/unified/20170814.060151 submit/tizen/20170811.083302
authorsinikang <sinikang@samsung.com>
Fri, 11 Aug 2017 08:16:56 +0000 (17:16 +0900)
committersinikang <sinikang@samsung.com>
Fri, 11 Aug 2017 08:16:56 +0000 (17:16 +0900)
Change-Id: I02400f90937d86536f434901b9ef4ba00dd92cc1

CMakeLists.txt
packaging/tel-plugin-packetservice.spec [changed mode: 0755->0644]
resources/500.dnet_db_upgrade_24_30.sh [deleted file]
resources/500.dnet_db_upgrade_30_40.sh [new file with mode: 0644]
resources/dnet_db_upgrade_24_30.sql [deleted file]
resources/dnet_db_upgrade_30_40.sql [new file with mode: 0644]

index 1592e0824233e86d4283bd47d7f16c6f01ca21c6..c5dc9dc436cfbc99fe77c298badff6cafd26be7f 100644 (file)
@@ -67,8 +67,8 @@ SET_TARGET_PROPERTIES(ps-plugin PROPERTIES PREFIX "" OUTPUT_NAME ps-plugin)
 
 # install
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/dnet_db.sql DESTINATION ${DATAROOTDIR}/ps-plugin)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/dnet_db_upgrade_24_30.sql DESTINATION ${DATAROOTDIR}/ps-plugin)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/500.dnet_db_upgrade_24_30.sh DESTINATION ${DATAROOTDIR}/upgrade/scripts)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/dnet_db_upgrade_30_40.sql DESTINATION ${DATAROOTDIR}/ps-plugin)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/500.dnet_db_upgrade_30_40.sh DESTINATION ${DATAROOTDIR}/upgrade/scripts)
 INSTALL(FILES ${RES_DIR}/dnet_db_init.sql DESTINATION ${DATAROOTDIR}/ps-plugin)
 #INSTALL(FILES ${CMAKE_SOURCE_DIR}/resources/apns-conf.xml DESTINATION ${DATAROOTDIR}/ps-plugin)
 INSTALL(TARGETS ps-plugin LIBRARY DESTINATION ${LIBDIR}/telephony/plugins)
old mode 100755 (executable)
new mode 100644 (file)
index 96ed43b..8e41043
@@ -4,7 +4,7 @@
 
 %define major 0
 %define minor 4
-%define patchlevel 11
+%define patchlevel 12
 
 Name:           tel-plugin-packetservice
 Version:        %{major}.%{minor}.%{patchlevel}
@@ -210,8 +210,8 @@ esac
 %defattr(644,root,root,-)
 #%doc COPYING
 %{_datadir}/ps-plugin/dnet_db.sql
-%{_datadir}/ps-plugin/dnet_db_upgrade_24_30.sql
-%{_datadir}/upgrade/scripts/500.dnet_db_upgrade_24_30.sh
+%{_datadir}/ps-plugin/dnet_db_upgrade_30_40.sql
+%{_datadir}/upgrade/scripts/500.dnet_db_upgrade_30_40.sh
 #%{_datadir}/ps-plugin/apns-conf.xml
 %{_libdir}/telephony/plugins/ps-plugin*
 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
diff --git a/resources/500.dnet_db_upgrade_24_30.sh b/resources/500.dnet_db_upgrade_24_30.sh
deleted file mode 100644 (file)
index 25d97fd..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-/usr/bin/sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db_upgrade_24_30.sql
-/usr/bin/sqlite3 /opt/dbspace/.dnet2.db < /usr/share/ps-plugin/dnet_db_upgrade_24_30.sql
-
-chown telephony:telephony /opt/dbspace/.dnet.db
-chown telephony:telephony /opt/dbspace/.dnet.db-journal
-chown telephony:telephony /opt/dbspace/.dnet2.db
-chown telephony:telephony /opt/dbspace/.dnet2.db-journal
-
-chsmack -a System /opt/dbspace/.dnet.db
-chsmack -a System /opt/dbspace/.dnet.db-journal
-chsmack -a System /opt/dbspace/.dnet2.db
-chsmack -a System /opt/dbspace/.dnet2.db-journal
diff --git a/resources/500.dnet_db_upgrade_30_40.sh b/resources/500.dnet_db_upgrade_30_40.sh
new file mode 100644 (file)
index 0000000..30589e5
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+/usr/bin/sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db_upgrade_30_40.sql
+/usr/bin/sqlite3 /opt/dbspace/.dnet2.db < /usr/share/ps-plugin/dnet_db_upgrade_34_40.sql
+
+chown telephony:telephony /opt/dbspace/.dnet.db
+chown telephony:telephony /opt/dbspace/.dnet.db-journal
+chown telephony:telephony /opt/dbspace/.dnet2.db
+chown telephony:telephony /opt/dbspace/.dnet2.db-journal
+
+chsmack -a System /opt/dbspace/.dnet.db
+chsmack -a System /opt/dbspace/.dnet.db-journal
+chsmack -a System /opt/dbspace/.dnet2.db
+chsmack -a System /opt/dbspace/.dnet2.db-journal
diff --git a/resources/dnet_db_upgrade_24_30.sql b/resources/dnet_db_upgrade_24_30.sql
deleted file mode 100644 (file)
index e2aa7ff..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-PRAGMA journal_mode = PERSIST;
-PRAGMA synchronous = OFF;
-PRAGMA locking_mode = EXCLUSIVE;
-PRAGMA temp_store = MEMORY;
-PRAGMA cache_size=-5000;
-
-DROP TABLE IF EXISTS "pdp_profile_upgrade";
-CREATE TABLE pdp_profile_upgrade(
-       profile_id           INTEGER PRIMARY KEY,
-       profile_name         TEXT,
-       apn                  TEXT,
-       auth_type            INTEGER,
-       auth_id              TEXT,
-       auth_pwd             TEXT,
-       pdp_protocol         INTEGER,
-       roam_pdp_protocol    INTEGER,
-       proxy_ip_addr        TEXT,
-       home_url             TEXT,
-       linger_time          INTEGER,
-       traffic_class        INTEGER,
-       is_static_ip_addr    INTEGER,
-       ip_addr              TEXT,
-       is_static_dns_addr   INTEGER,
-       dns_addr1            TEXT,
-       dns_addr2            TEXT,
-       network_info_id      INTEGER,
-       svc_category_id      INTEGER,
-       hidden               INTEGER,
-       editable             INTEGER,
-       default_internet_con INTEGER,
-       user_defined         INTEGER,
-       is_roaming_apn       INTEGER,
-       profile_enable       INTEGER
-);
-
-INSERT INTO pdp_profile_upgrade
- SELECT profile_id, profile_name, apn, auth_type, auth_id, auth_pwd, pdp_protocol, pdp_protocol, proxy_ip_addr, home_url, linger_time, traffic_class, is_static_ip_addr, ip_addr, is_static_dns_addr, dns_addr1, dns_addr2, network_info_id, svc_category_id, hidden, editable, default_internet_con, user_defined, is_roaming_apn, profile_enable
- FROM 'pdp_profile';
-
-DROP TABLE 'pdp_profile';
-ALTER TABLE 'pdp_profile_upgrade' RENAME TO 'pdp_profile';
-
-DROP INDEX IF EXISTS "pdp_profile_ix_1";
-CREATE INDEX pdp_profile_ix_1 ON pdp_profile (network_info_id);
diff --git a/resources/dnet_db_upgrade_30_40.sql b/resources/dnet_db_upgrade_30_40.sql
new file mode 100644 (file)
index 0000000..e2aa7ff
--- /dev/null
@@ -0,0 +1,44 @@
+PRAGMA journal_mode = PERSIST;
+PRAGMA synchronous = OFF;
+PRAGMA locking_mode = EXCLUSIVE;
+PRAGMA temp_store = MEMORY;
+PRAGMA cache_size=-5000;
+
+DROP TABLE IF EXISTS "pdp_profile_upgrade";
+CREATE TABLE pdp_profile_upgrade(
+       profile_id           INTEGER PRIMARY KEY,
+       profile_name         TEXT,
+       apn                  TEXT,
+       auth_type            INTEGER,
+       auth_id              TEXT,
+       auth_pwd             TEXT,
+       pdp_protocol         INTEGER,
+       roam_pdp_protocol    INTEGER,
+       proxy_ip_addr        TEXT,
+       home_url             TEXT,
+       linger_time          INTEGER,
+       traffic_class        INTEGER,
+       is_static_ip_addr    INTEGER,
+       ip_addr              TEXT,
+       is_static_dns_addr   INTEGER,
+       dns_addr1            TEXT,
+       dns_addr2            TEXT,
+       network_info_id      INTEGER,
+       svc_category_id      INTEGER,
+       hidden               INTEGER,
+       editable             INTEGER,
+       default_internet_con INTEGER,
+       user_defined         INTEGER,
+       is_roaming_apn       INTEGER,
+       profile_enable       INTEGER
+);
+
+INSERT INTO pdp_profile_upgrade
+ SELECT profile_id, profile_name, apn, auth_type, auth_id, auth_pwd, pdp_protocol, pdp_protocol, proxy_ip_addr, home_url, linger_time, traffic_class, is_static_ip_addr, ip_addr, is_static_dns_addr, dns_addr1, dns_addr2, network_info_id, svc_category_id, hidden, editable, default_internet_con, user_defined, is_roaming_apn, profile_enable
+ FROM 'pdp_profile';
+
+DROP TABLE 'pdp_profile';
+ALTER TABLE 'pdp_profile_upgrade' RENAME TO 'pdp_profile';
+
+DROP INDEX IF EXISTS "pdp_profile_ix_1";
+CREATE INDEX pdp_profile_ix_1 ON pdp_profile (network_info_id);