summaryrefslogtreecommitdiffstats
path: root/main/acf-weblog/acf-weblog.post-upgrade
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-08-21 16:25:38 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2012-08-21 16:27:05 +0200
commit5fd2bd4ddab35efe5523a225b81160831b866f9b (patch)
tree292e975ef83af8c2177737b236e6f7f443d3c596 /main/acf-weblog/acf-weblog.post-upgrade
parentdb3867df2088ca37bed812d9747d337543c6a8b6 (diff)
downloadaports-5fd2bd4ddab35efe5523a225b81160831b866f9b.tar.bz2
aports-5fd2bd4ddab35efe5523a225b81160831b866f9b.tar.xz
main/acf-weblog: let user manually update database schema
Diffstat (limited to 'main/acf-weblog/acf-weblog.post-upgrade')
-rwxr-xr-xmain/acf-weblog/acf-weblog.post-upgrade63
1 files changed, 7 insertions, 56 deletions
diff --git a/main/acf-weblog/acf-weblog.post-upgrade b/main/acf-weblog/acf-weblog.post-upgrade
index 18ed542fc..78822061e 100755
--- a/main/acf-weblog/acf-weblog.post-upgrade
+++ b/main/acf-weblog/acf-weblog.post-upgrade
@@ -3,63 +3,14 @@
new=$1
old=$2
-# if current is older than 0.4.0 we update.
-if [ "$(apk version -t $old 0.4.0)" = "<" ]; then
-
-psql -U postgres -c "ALTER TABLE weblog ADD COLUMN shortreason text" \
- webproxylog
-psql -U postgres -c "ALTER TABLE pubweblog ADD COLUMN shortreason text" \
- webproxylog
-psql -U postgres -c "ALTER TABLE pubblocklog ADD COLUMN shortreason text" \
- webproxylog
-psql -U postgres -c "ALTER TABLE blocklog ADD COLUMN shortreason text" \
- webproxylog
-
-fi
-
-# if current is older than 0.4.5 we update.
-if [ "$(apk version -t $old 0.4.5)" = "<" ]; then
-
-psql -U postgres -c "ALTER TABLE dbhistlog ALTER logdatetime TYPE timestamp(3)"\
- webproxylog
-
-fi
-
-
-# if current is older than 0.5.4 we update.
-if [ "$(apk version -t $old 0.5.4)" = "<" ]; then
-
-psql -U postgres -c "ALTER TABLE weblog ALTER bytes TYPE bigint"\
- webproxylog
-psql -U postgres -c "ALTER TABLE pubweblog ALTER bytes TYPE bigint"\
- webproxylog
-psql -U postgres -c "ALTER TABLE blocklog ALTER bytes TYPE bigint"\
- webproxylog
-psql -U postgres -c "ALTER TABLE pubblocklog ALTER bytes TYPE bigint"\
- webproxylog
-
-fi
-
-# if current is older than 0.6.0 we update.
if [ "$(apk version -t $old 0.6.0)" = "<" ]; then
-
-mkdir /etc/weblog
-mv /etc/weblog.conf /etc/weblog/
-echo "Executing db updates"
-psql -U postgres -c "ALTER TABLE pubweblog ADD COLUMN badyesno int, ADD COLUMN deniedyesno int, ADD COLUMN bypassyesno int, ADD COLUMN wordloc text, ADD COLUMN goodwordloc text, ADD COLUMN selected boolean, ADD COLUMN id int UNIQUE" -d webproxylog
-psql -U weblogowner -c "CREATE SEQUENCE pubweblog_id_seq" -d webproxylog
-psql -U postgres -c "ALTER TABLE pubweblog ALTER COLUMN id SET DEFAULT NEXTVAL('pubweblog_id_seq')" -d webproxylog
-psql -U postgres -c "UPDATE pubweblog SET id = NEXTVAL('pubweblog_id_seq')" -d webproxylog
-psql -U postgres -c "INSERT INTO pubweblog SELECT *,'0','1','0','','','false' FROM pubblocklog" -d webproxylog
-psql -U postgres -c "INSERT INTO pubweblog SELECT *,'0','0','0','','','false' FROM weblog" -d webproxylog
-psql -U postgres -c "INSERT INTO pubweblog SELECT *,'0','1','0','','','false' FROM blocklog" -d webproxylog
-psql -U postgres -c "ALTER TABLE weblog ADD COLUMN badyesno int, ADD COLUMN deniedyesno int, ADD COLUMN bypassyesno int, ADD COLUMN wordloc text, ADD COLUMN goodwordloc text" -d webproxylog
-psql -U weblogowner -c "CREATE TABLE pubweblog_history(sourcename character varying(40), clientip inet NOT NULL, clientuserid character varying(64) NOT NULL, logdatetime timestamp(3) without time zone NOT NULL, uri text NOT NULL, bytes bigint NOT NULL, reason text, score integer, shortreason text, badyesno int, deniedyesno int, bypassyesno int, wordloc text, goodwordloc text, selected boolean, id int)" -d webproxylog
-psql -U postgres -c "GRANT SELECT ON pubweblog_history TO webloguser" -d webproxylog
-psql -U postgres -c "DROP TABLE pubblocklog" -d webproxylog
-psql -U postgres -c "DROP TABLE watchlist" -d webproxylog
-psql -U postgres -c "DROP TABLE blocklog" -d webproxylog
-
+ mkdir /etc/weblog
+ mv /etc/weblog.conf /etc/weblog/
+ cat <<EOF
+*
+* NOTE: You need to manually run /usr/sbin/acf-weblog-update-schema
+*
+EOF
fi
exit 0