liquid_feedback_core

view lf_export @ 61:598af132a6f9

Save battle data from calls of "clean_issue"("issue"."id")

Details:
- Calling "clean_issue" is also allowed before ranks are calculated
- View "battle" was renamed to "battle_view"
- "battle_view" only contains entries for closed issues
- New table "battle", which is filled when an issue is closed
- Version change to v1.2.2
- Update script to v1.2.2 materializes battles of existent (closed) issues
author jbe
date Tue Jul 20 00:53:30 2010 +0200 (2010-07-20)
parents 2b03946cb0c2
children
line source
1 #!/bin/sh
3 if [ -z "$1" -o -z "$2" ]; then
4 echo "Usage: $0 <dbname> <filename>.sql.gz"
5 exit 1
6 fi
8 EXPORT_DBNAME=liquid_feedback_autoexport
9 retval=0
11 echo "Dropping database \"$EXPORT_DBNAME\" if existent..."
12 dropdb "$EXPORT_DBNAME" 2> /dev/null
13 echo "Copying database \"$1\" to new database \"$EXPORT_DBNAME\"..."
14 # TODO: use character encoding of original database
15 if (createdb "$EXPORT_DBNAME" && pg_dump "$1" | psql -f - "$EXPORT_DBNAME" > /dev/null)
16 then
17 echo "Deleting private data in copied database..."
18 if psql -v ON_ERROR_STOP=1 -c 'SELECT delete_private_data()' "$EXPORT_DBNAME" > /dev/null
19 then
20 echo "Dumping and compressing copied database to \"$2\"..."
21 if pg_dump --no-owner --no-privileges "$EXPORT_DBNAME" | gzip -9 > "$2"
22 then
23 true
24 else
25 retval=4
26 fi
27 else
28 retval=3
29 fi
30 else
31 retval=2
32 fi
33 echo "Dropping database \"$EXPORT_DBNAME\"..."
34 dropdb "$EXPORT_DBNAME"
35 echo "DONE."
36 exit $retval

Impressum / About Us