liquid_feedback_core

view README @ 126:5edfb00d840a

Implementation of Schulze's Supermajority Requirements

Changes in detail:
- Renamed column "agreed" of table "initiative" to "majority"
- Added column "winner" to table "initiative"
- Extended constraint "non_admitted_initiatives_cant_contain_voting_results" of table "initiative" to "rank" and "winner" columns
- Removed constraint "non_agreed_initiatives_cant_get_a_rank" from table "initiative"
- Replaced PRIMARY KEY of "battle" table by a single NOT NULL constraint on column "issue_id" and three (partial) indicies allowing NULL values as initiative ids
- Added constraint "initiative_ids_not_equal" to "battle" table
- Added view "battle_participant" which selects admitted initiatives plus one virtual "status-quo" initiative for each issue denoted by an initiative_id being NULL
- Modified "battle_view" to include all admitted initiatives plus the virtual "status-quo" initiative
- Modified function "calculate_ranks" to respect all battle participants, to set the rank of all initiatives where the rank is better than status-quo, and to mark the final winner (if existent)
author jbe
date Tue May 24 03:01:49 2011 +0200 (2011-05-24)
parents 92fc60ed705d
children fa394b8a0157
line source
2 Setup the database:
3 $ createdb liquid_feedback
4 $ psql -v ON_ERROR_STOP=1 -f core.sql liquid_feedback
6 Optionally insert demo data:
7 $ psql -v ON_ERROR_STOP=1 -f demo.sql liquid_feedback
9 Compile lf_update binary:
10 $ make
12 If you wish, copy the created lf_update file to /usr/local/bin or a
13 similar directory. Ensure that "lf_update dbname=liquid_feedback"
14 is called regularly. On successful run, lf_update will not produce
15 any output and exit with code 0.
17 NOTE: When writing to the database, some INSERTs must be executed
18 within the same transaction, e.g. issues can't exist without
19 an initiative and vice versa.
21 To create an export file, which is containing all but private data,
22 you may use the lf_export shell-script:
23 $ lf_export liquid_feedback export.sql.gz
25 To uninstall the software, delete the lf_update binary
26 and drop the database by entering the following command:
27 $ dropdb liquid_feedback
29 Updating is done using the update scripts in the update/ directory.
30 After updating it is recommended to recreate the schema as follows:
31 $ pg_dump --disable-triggers --data-only DATABASE_NAME > tmp.sql
32 $ dropdb DATABASE_NAME
33 $ createdb DATABASE_NAME
34 $ psql -v ON_ERROR_STOP=1 -f core.sql DATABASE_NAME
35 $ psql -v ON_ERROR_STOP=1 -f tmp.sql DATABASE_NAME
36 $ rm tmp.sql

Impressum / About Us