liquid_feedback_core

view init.sql @ 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 58451b5565ae
children 6fce4f08157b
line source
1 -- NOTE: This file creates an admin user with an empty password!
3 BEGIN;
5 INSERT INTO "unit" (
6 "active",
7 "name",
8 "description"
9 ) VALUES (
10 true,
11 'Default unit',
12 'Default unit created by init script.'
13 );
16 INSERT INTO "member" (
17 "login",
18 "password",
19 "active",
20 "admin",
21 "name"
22 ) VALUES (
23 'admin',
24 '$1$.EMPTY.$LDufa24OE2HZFXAXh71Eb1',
25 TRUE,
26 TRUE,
27 'Administrator' );
29 INSERT INTO "policy" (
30 "index",
31 "active",
32 "name",
33 "description",
34 "admission_time",
35 "discussion_time",
36 "verification_time",
37 "voting_time",
38 "issue_quorum_num",
39 "issue_quorum_den",
40 "initiative_quorum_num",
41 "initiative_quorum_den"
42 ) VALUES (
43 1,
44 TRUE,
45 'Extensive proceeding',
46 DEFAULT,
47 '1 month',
48 '5 months',
49 '1 month',
50 '3 weeks',
51 10, 100,
52 10, 100
53 ), (
54 2,
55 TRUE,
56 'Standard proceeding',
57 DEFAULT,
58 '1 month',
59 '1 month',
60 '1 week',
61 '1 week',
62 10, 100,
63 10, 100
64 ), (
65 3,
66 TRUE,
67 'Fast proceeding',
68 DEFAULT,
69 '48 hours',
70 '3 hours',
71 '1 hour',
72 '20 hours',
73 1, 100,
74 1, 100 );
76 INSERT INTO "area" (
77 "unit_id",
78 "active",
79 "name",
80 "description"
81 ) VALUES (
82 1,
83 TRUE,
84 'Generic area',
85 DEFAULT );
87 COMMIT;

Impressum / About Us