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