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@622
|
6 Optionally add geospatial indices (if desired):
|
jbe@622
|
7 $ psql -v ON_ERROR_STOP=1 -f geoindex_install.sql liquid_feedback
|
jbe@622
|
8
|
jbe@622
|
9 Note: Geospatial indices require the pgLatLon extension to be
|
jbe@622
|
10 installed, which may be obtained from:
|
jbe@622
|
11 http://www.public-software-group.org/pgLatLon
|
jbe@622
|
12
|
jbe@0
|
13 Optionally insert demo data:
|
jbe@0
|
14 $ psql -v ON_ERROR_STOP=1 -f demo.sql liquid_feedback
|
jbe@0
|
15
|
jbe@0
|
16 Compile lf_update binary:
|
jbe@0
|
17 $ make
|
jbe@0
|
18
|
jbe@435
|
19 Ensure that "lf_update dbname=liquid_feedback",
|
jbe@435
|
20 "lf_update_issue_order dbname=liquid_feedback", and
|
jbe@380
|
21 "lf_update_suggestion_order dbname=liquid_feedback" are called
|
jbe@380
|
22 regularly! It is required to run these commands regularly
|
jbe@380
|
23 (i.e. every 5 minutes via cron) to update cached supporter counts,
|
jbe@380
|
24 to change the state of issues when neccessary, to calculate the
|
jbe@380
|
25 result of votings, etc. If you wish, copy the created lf_update
|
jbe@380
|
26 and lf_update_suggestion_order files to /usr/local/bin or a
|
jbe@380
|
27 similar directory.
|
jbe@202
|
28
|
jbe@380
|
29 It is possible to run these two commands in parallel, if a setup
|
jbe@380
|
30 requires splitting the load to multiple processor cores. In other
|
jbe@380
|
31 cases it is recommended to run "lf_update" first, and then
|
jbe@435
|
32 "lf_update_issue_order" and "lf_update_suggestion_order".
|
jbe@202
|
33
|
jbe@380
|
34 On successful run, these commands will not produce any output
|
jbe@435
|
35 and exit with code 0. The commands "lf_update_issue_order" and
|
jbe@435
|
36 "lf_update_suggestion_order" may be called with a first argument
|
jbe@435
|
37 of "-v" to print log output.
|
jbe@0
|
38
|
jbe@0
|
39 NOTE: When writing to the database, some INSERTs must be executed
|
jbe@0
|
40 within the same transaction, e.g. issues can't exist without
|
jbe@0
|
41 an initiative and vice versa.
|
jbe@0
|
42
|
jbe@8
|
43 To create an export file, which is containing all but private data,
|
jbe@8
|
44 you may use the lf_export shell-script:
|
jbe@8
|
45 $ lf_export liquid_feedback export.sql.gz
|
jbe@8
|
46
|
jbe@274
|
47 Refer to source code of function "delete_private_data"() to see,
|
jbe@274
|
48 which data gets deleted. If you need a different behaviour, please
|
jbe@274
|
49 copy the function and modify the lf_export shell script accordingly.
|
jbe@274
|
50
|
jbe@0
|
51 To uninstall the software, delete the lf_update binary
|
jbe@0
|
52 and drop the database by entering the following command:
|
jbe@0
|
53 $ dropdb liquid_feedback
|
jbe@0
|
54
|
jbe@120
|
55 Updating is done using the update scripts in the update/ directory.
|
jbe@350
|
56 Do not forget to make backups, before installing any updates.
|
jbe@251
|
57 After updating it is recommended to recreate the schema as follows
|
jbe@251
|
58 (assuming the database superuser is named "postgres"):
|
jbe@120
|
59 $ pg_dump --disable-triggers --data-only DATABASE_NAME > tmp.sql
|
jbe@120
|
60 $ dropdb DATABASE_NAME
|
jbe@120
|
61 $ createdb DATABASE_NAME
|
jbe@120
|
62 $ psql -v ON_ERROR_STOP=1 -f core.sql DATABASE_NAME
|
jbe@251
|
63 $ su postgres # (execute following command as database superuser)
|
jbe@120
|
64 $ psql -v ON_ERROR_STOP=1 -f tmp.sql DATABASE_NAME
|
jbe@251
|
65 $ exit # leave "su" command
|
jbe@120
|
66 $ rm tmp.sql
|
jbe@120
|
67
|
jbe@605
|
68 NOTE: If PostgreSQL fails to locate the extensions' datatypes, it may
|
jbe@605
|
69 be necessary to add 'public' to the 'search_path' variable in
|
jbe@605
|
70 the data-only export (tmp.sql in the example above), which is
|
jbe@605
|
71 set by the function call pg_catalog.set_config(...).
|
jbe@605
|
72
|