annotate README @ 500:c1a2954078d7

Fixed minor error in update script (DROP VIEW instead of DROP TABLE)
author jbe
date Mon Apr 04 18:46:44 2016 +0200 (2016-04-04)
parents e3dd2c3629db
children 37d6d15919f1
rev   line source
jbe@0 1
jbe@0 2 Setup the database:
jbe@0 3 $ createdb liquid_feedback
jbe@0 4 $ psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
jbe@0 5
jbe@0 6 Optionally insert demo data:
jbe@0 7 $ psql -v ON_ERROR_STOP=1 -f demo.sql liquid_feedback
jbe@0 8
jbe@0 9 Compile lf_update binary:
jbe@0 10 $ make
jbe@0 11
jbe@435 12 Ensure that "lf_update dbname=liquid_feedback",
jbe@435 13 "lf_update_issue_order dbname=liquid_feedback", and
jbe@380 14 "lf_update_suggestion_order dbname=liquid_feedback" are called
jbe@380 15 regularly! It is required to run these commands regularly
jbe@380 16 (i.e. every 5 minutes via cron) to update cached supporter counts,
jbe@380 17 to change the state of issues when neccessary, to calculate the
jbe@380 18 result of votings, etc. If you wish, copy the created lf_update
jbe@380 19 and lf_update_suggestion_order files to /usr/local/bin or a
jbe@380 20 similar directory.
jbe@202 21
jbe@380 22 It is possible to run these two commands in parallel, if a setup
jbe@380 23 requires splitting the load to multiple processor cores. In other
jbe@380 24 cases it is recommended to run "lf_update" first, and then
jbe@435 25 "lf_update_issue_order" and "lf_update_suggestion_order".
jbe@202 26
jbe@380 27 On successful run, these commands will not produce any output
jbe@435 28 and exit with code 0. The commands "lf_update_issue_order" and
jbe@435 29 "lf_update_suggestion_order" may be called with a first argument
jbe@435 30 of "-v" to print log output.
jbe@0 31
jbe@0 32 NOTE: When writing to the database, some INSERTs must be executed
jbe@0 33 within the same transaction, e.g. issues can't exist without
jbe@0 34 an initiative and vice versa.
jbe@0 35
jbe@8 36 To create an export file, which is containing all but private data,
jbe@8 37 you may use the lf_export shell-script:
jbe@8 38 $ lf_export liquid_feedback export.sql.gz
jbe@8 39
jbe@274 40 Refer to source code of function "delete_private_data"() to see,
jbe@274 41 which data gets deleted. If you need a different behaviour, please
jbe@274 42 copy the function and modify the lf_export shell script accordingly.
jbe@274 43
jbe@0 44 To uninstall the software, delete the lf_update binary
jbe@0 45 and drop the database by entering the following command:
jbe@0 46 $ dropdb liquid_feedback
jbe@0 47
jbe@120 48 Updating is done using the update scripts in the update/ directory.
jbe@350 49 Do not forget to make backups, before installing any updates.
jbe@251 50 After updating it is recommended to recreate the schema as follows
jbe@251 51 (assuming the database superuser is named "postgres"):
jbe@120 52 $ pg_dump --disable-triggers --data-only DATABASE_NAME > tmp.sql
jbe@120 53 $ dropdb DATABASE_NAME
jbe@120 54 $ createdb DATABASE_NAME
jbe@120 55 $ psql -v ON_ERROR_STOP=1 -f core.sql DATABASE_NAME
jbe@251 56 $ su postgres # (execute following command as database superuser)
jbe@120 57 $ psql -v ON_ERROR_STOP=1 -f tmp.sql DATABASE_NAME
jbe@251 58 $ exit # leave "su" command
jbe@120 59 $ rm tmp.sql
jbe@120 60

Impressum / About Us