liquid_feedback_core
annotate README @ 336:a7537038640d
Cleanup of new code for allowing "lf_update" to run without extensive locking
- Removed unnecessary variable "direct_voter_update_v" in function "forbid_changes_on_closed_issue_trigger"()
- Added PERFORM "require_transaction_isolation"() in more functions
- Integrated functions "issue_admission", "initiative_admission" and "freeze_after_snapshot" into "check_issue" function
- Removed function "manual_freeze" (replacement: set "issue" timings accordingly, when needed)
- Added/modified some comments
- Removed unnecessary variable "direct_voter_update_v" in function "forbid_changes_on_closed_issue_trigger"()
- Added PERFORM "require_transaction_isolation"() in more functions
- Integrated functions "issue_admission", "initiative_admission" and "freeze_after_snapshot" into "check_issue" function
- Removed function "manual_freeze" (replacement: set "issue" timings accordingly, when needed)
- Added/modified some comments
author | jbe |
---|---|
date | Wed Feb 20 02:56:49 2013 +0100 (2013-02-20) |
parents | 9ef1765082a7 |
children | 49c25dbc27bc |
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@202 | 12 Ensure that "lf_update dbname=liquid_feedback" is called regularly! |
jbe@202 | 13 |
jbe@202 | 14 It is required that lf_update is executed regulary (i.e. every |
jbe@202 | 15 5 minutes via cron) to update cached supporter counts, to change |
jbe@202 | 16 the state of issues when neccessary, and to calculate the result |
jbe@202 | 17 of votings. If you wish, copy the created lf_update file to |
jbe@202 | 18 /usr/local/bin or a similar directory. |
jbe@202 | 19 |
jbe@202 | 20 On successful run, lf_update will not produce any output |
jbe@202 | 21 and exit with code 0. |
jbe@0 | 22 |
jbe@0 | 23 NOTE: When writing to the database, some INSERTs must be executed |
jbe@0 | 24 within the same transaction, e.g. issues can't exist without |
jbe@0 | 25 an initiative and vice versa. |
jbe@0 | 26 |
jbe@8 | 27 To create an export file, which is containing all but private data, |
jbe@8 | 28 you may use the lf_export shell-script: |
jbe@8 | 29 $ lf_export liquid_feedback export.sql.gz |
jbe@8 | 30 |
jbe@274 | 31 Refer to source code of function "delete_private_data"() to see, |
jbe@274 | 32 which data gets deleted. If you need a different behaviour, please |
jbe@274 | 33 copy the function and modify the lf_export shell script accordingly. |
jbe@274 | 34 |
jbe@0 | 35 To uninstall the software, delete the lf_update binary |
jbe@0 | 36 and drop the database by entering the following command: |
jbe@0 | 37 $ dropdb liquid_feedback |
jbe@0 | 38 |
jbe@120 | 39 Updating is done using the update scripts in the update/ directory. |
jbe@251 | 40 After updating it is recommended to recreate the schema as follows |
jbe@251 | 41 (assuming the database superuser is named "postgres"): |
jbe@120 | 42 $ pg_dump --disable-triggers --data-only DATABASE_NAME > tmp.sql |
jbe@120 | 43 $ dropdb DATABASE_NAME |
jbe@120 | 44 $ createdb DATABASE_NAME |
jbe@120 | 45 $ psql -v ON_ERROR_STOP=1 -f core.sql DATABASE_NAME |
jbe@251 | 46 $ su postgres # (execute following command as database superuser) |
jbe@120 | 47 $ psql -v ON_ERROR_STOP=1 -f tmp.sql DATABASE_NAME |
jbe@251 | 48 $ exit # leave "su" command |
jbe@120 | 49 $ rm tmp.sql |
jbe@120 | 50 |