From ed0aee3e414f0b0253eb353f503732b168676e65 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 15 Apr 2011 17:44:29 +0000 Subject: main/acf-provisioning: added post-upgrade script for database changes --- .../acf-provisioning/acf-provisioning.post-upgrade | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 main/acf-provisioning/acf-provisioning.post-upgrade (limited to 'main/acf-provisioning/acf-provisioning.post-upgrade') 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 + -- cgit v1.2.3