# 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/dnet_db_upgrade_24_30.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)
%define major 0
%define minor 3
-%define patchlevel 29
+%define patchlevel 30
Name: tel-plugin-packetservice
Version: %{major}.%{minor}.%{patchlevel}
#%doc COPYING
%{_datadir}/ps-plugin/dnet_db.sql
%{_datadir}/ps-plugin/dnet_db_init.sql
+%{_datadir}/ps-plugin/dnet_db_upgrade_24_30.sql
+%{_datadir}/upgrade/scripts/dnet_db_upgrade_24_30.sh
#%{_datadir}/ps-plugin/apns-conf.xml
%{_libdir}/telephony/plugins/ps-plugin*
%{_datadir}/license/tel-plugin-packetservice
--- /dev/null
+#!/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
+rm -f /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
--- /dev/null
+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);