aboutsummaryrefslogtreecommitdiffstats
path: root/main/acf-provisioning/acf-provisioning.post-upgrade
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-04-15 17:44:29 +0000
committerTed Trask <ttrask01@yahoo.com>2011-04-15 17:44:29 +0000
commited0aee3e414f0b0253eb353f503732b168676e65 (patch)
tree54ab9e513f56b32a99f0c35e7b015fe7c47c1119 /main/acf-provisioning/acf-provisioning.post-upgrade
parentdc4b238abb04faf222b10b5df5c0b1d101a04284 (diff)
downloadaports-ed0aee3e414f0b0253eb353f503732b168676e65.tar.bz2
aports-ed0aee3e414f0b0253eb353f503732b168676e65.tar.xz
main/acf-provisioning: added post-upgrade script for database changes
Diffstat (limited to 'main/acf-provisioning/acf-provisioning.post-upgrade')
-rw-r--r--main/acf-provisioning/acf-provisioning.post-upgrade23
1 files changed, 23 insertions, 0 deletions
diff --git a/main/acf-provisioning/acf-provisioning.post-upgrade b/main/acf-provisioning/acf-provisioning.post-upgrade
new file mode 100644
index 0000000000..035be21475
--- /dev/null
+++ b/main/acf-provisioning/acf-provisioning.post-upgrade
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+new=$1
+old=$2
+
+# if current is not older than 0.0.7-r1 we exit.
+if ! [ "$(apk version -t $old 0.0.7-r1)" = "<" ]; then
+ exit 0
+fi
+
+psql -U postgres -c "INSERT INTO provisioning_classes VALUES(default, (SELECT class_group_id FROM provisioning_class_groups WHERE name='device'), 'Unsupported Phone', '999')"\
+ provisioning
+psql -U postgres -c "INSERT INTO provisioning_groups VALUES(default, 'reg1', 'Registration 1 Unsupported', '10')"\
+ provisioning
+psql -U postgres -c "INSERT INTO classes_to_param_groups VALUES((SELECT class_id FROM provisioning_classes WHERE label='Unsupported Phone'), (SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'))"\
+ provisioning
+psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'), (SELECT param_id FROM provisioning_params WHERE name='extension'), null, true)"\
+ provisioning
+psql -U postgres -c "INSERT INTO param_groups_to_params VALUES((SELECT group_id FROM provisioning_groups WHERE label='Registration 1 Unsupported'), (SELECT param_id FROM provisioning_params WHERE name='password'), null, true)"\
+ provisioning
+
+exit 0
+