liquid_feedback_core

changeset 207:73d358fe20c7

Clarified comments, added warnings in comments about correct usage of indicies
author jbe
date Mon Nov 14 13:55:23 2011 +0100 (2011-11-14)
parents e14cb823f107
children 37bf1dcdb37a
files core.sql
line diff
     1.1 --- a/core.sql	Mon Nov 14 13:48:22 2011 +0100
     1.2 +++ b/core.sql	Mon Nov 14 13:55:23 2011 +0100
     1.3 @@ -137,7 +137,7 @@
     1.4  COMMENT ON COLUMN "member"."created"              IS 'Creation of member record and/or invite code';
     1.5  COMMENT ON COLUMN "member"."invite_code"          IS 'Optional invite code, to allow a member to initialize his/her account the first time';
     1.6  COMMENT ON COLUMN "member"."admin_comment"        IS 'Hidden comment for administrative purposes';
     1.7 -COMMENT ON COLUMN "member"."activated"            IS 'Timestamp of activation of account (i.e. usage of "invite_code"); required to be set for "active" members';
     1.8 +COMMENT ON COLUMN "member"."activated"            IS 'Timestamp of first activation of account (i.e. usage of "invite_code"); required to be set for "active" members';
     1.9  COMMENT ON COLUMN "member"."last_activity"        IS 'Date of last activity of member; required to be set for "active" members';
    1.10  COMMENT ON COLUMN "member"."last_login"           IS 'Timestamp of last login';
    1.11  COMMENT ON COLUMN "member"."login"                IS 'Login name';
    1.12 @@ -161,7 +161,7 @@
    1.13  COMMENT ON COLUMN "member"."external_memberships" IS 'Other organizations the member is involved in';
    1.14  COMMENT ON COLUMN "member"."external_posts"       IS 'Posts (offices) outside the organization';
    1.15  COMMENT ON COLUMN "member"."formatting_engine"    IS 'Allows different formatting engines (i.e. wiki formats) to be used for "member"."statement"';
    1.16 -COMMENT ON COLUMN "member"."statement"            IS 'Freely chosen text of the member for his homepage within the system';
    1.17 +COMMENT ON COLUMN "member"."statement"            IS 'Freely chosen text of the member for his/her profile';
    1.18  
    1.19  
    1.20  CREATE TYPE "application_access_level" AS ENUM
    1.21 @@ -332,12 +332,12 @@
    1.22  
    1.23  COMMENT ON COLUMN "policy"."index"                 IS 'Determines the order in listings';
    1.24  COMMENT ON COLUMN "policy"."active"                IS 'TRUE = policy can be used for new issues';
    1.25 -COMMENT ON COLUMN "policy"."admission_time"        IS 'Maximum time an issue stays open without being "accepted"';
    1.26 -COMMENT ON COLUMN "policy"."discussion_time"       IS 'Regular time until an issue is "half_frozen" after being "accepted"';
    1.27 -COMMENT ON COLUMN "policy"."verification_time"     IS 'Regular time until an issue is "fully_frozen" after being "half_frozen"';
    1.28 -COMMENT ON COLUMN "policy"."voting_time"           IS 'Time after an issue is "fully_frozen" but not "closed"';
    1.29 -COMMENT ON COLUMN "policy"."issue_quorum_num"      IS   'Numerator of potential supporter quorum to be reached by one initiative of an issue to be "accepted"';
    1.30 -COMMENT ON COLUMN "policy"."issue_quorum_den"      IS 'Denominator of potential supporter quorum to be reached by one initiative of an issue to be "accepted"';
    1.31 +COMMENT ON COLUMN "policy"."admission_time"        IS 'Maximum duration of issue state ''admission''; Maximum time an issue stays open without being "accepted"';
    1.32 +COMMENT ON COLUMN "policy"."discussion_time"       IS 'Duration of issue state ''discussion''; Regular time until an issue is "half_frozen" after being "accepted"';
    1.33 +COMMENT ON COLUMN "policy"."verification_time"     IS 'Duration of issue state ''verification''; Regular time until an issue is "fully_frozen" (e.g. entering issue state ''voting'') after being "half_frozen"';
    1.34 +COMMENT ON COLUMN "policy"."voting_time"           IS 'Duration of issue state ''voting''; Time after an issue is "fully_frozen" but not "closed" (duration of issue state ''voting'')';
    1.35 +COMMENT ON COLUMN "policy"."issue_quorum_num"      IS   'Numerator of potential supporter quorum to be reached by one initiative of an issue to be "accepted" and enter issue state ''discussion''';
    1.36 +COMMENT ON COLUMN "policy"."issue_quorum_den"      IS 'Denominator of potential supporter quorum to be reached by one initiative of an issue to be "accepted" and enter issue state ''discussion''';
    1.37  COMMENT ON COLUMN "policy"."initiative_quorum_num" IS   'Numerator of satisfied supporter quorum  to be reached by an initiative to be "admitted" for voting';
    1.38  COMMENT ON COLUMN "policy"."initiative_quorum_den" IS 'Denominator of satisfied supporter quorum to be reached by an initiative to be "admitted" for voting';
    1.39  COMMENT ON COLUMN "policy"."direct_majority_num"            IS 'Numerator of fraction of neccessary direct majority for initiatives to be attainable as winner';
    1.40 @@ -375,7 +375,7 @@
    1.41  COMMENT ON TABLE "unit" IS 'Organizational units organized as trees; Delegations are not inherited through these trees.';
    1.42  
    1.43  COMMENT ON COLUMN "unit"."parent_id"    IS 'Parent id of tree node; Multiple roots allowed';
    1.44 -COMMENT ON COLUMN "unit"."active"       IS 'TRUE means new issues can be created in units of this area';
    1.45 +COMMENT ON COLUMN "unit"."active"       IS 'TRUE means new issues can be created in areas of this area';
    1.46  COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege"';
    1.47  
    1.48  
    1.49 @@ -628,7 +628,7 @@
    1.50  COMMENT ON COLUMN "initiative"."worse_than_status_quo"   IS 'TRUE, if initiative has a schulze-ranking worse than the status quo (without tie-breaking)';
    1.51  COMMENT ON COLUMN "initiative"."reverse_beat_path"       IS 'TRUE, if there is a beat path (may include ties), from this initiative to the status quo';
    1.52  COMMENT ON COLUMN "initiative"."multistage_majority"     IS 'TRUE, if either (a) this initiative has no better rank than the status quo, or (b) there exists a better ranked initiative X, which directly beats this initiative, and either more voters prefer X to this initiative than voters preferring X to the status quo or less voters prefer this initiative to X than voters preferring the status quo to X';
    1.53 -COMMENT ON COLUMN "initiative"."eligible"                IS 'Initiative is "attainable" and depending on selected policy has no "reverse_beat_path" or "multistage_majority"';
    1.54 +COMMENT ON COLUMN "initiative"."eligible"                IS 'Initiative has a "direct_majority" and an "indirect_majority", is "better_than_status_quo" and depending on selected policy the initiative has no "reverse_beat_path" or "multistage_majority"';
    1.55  COMMENT ON COLUMN "initiative"."winner"                  IS 'Winner is the "eligible" initiative with best "schulze_rank" and in case of ties with lowest "id"';
    1.56  COMMENT ON COLUMN "initiative"."rank"                    IS 'Unique ranking for all "admitted" initiatives per issue; lower rank is better; a winner always has rank 1, but rank 1 does not imply that an initiative is winner; initiatives with "direct_majority" AND "indirect_majority" always have a better (lower) rank than other initiatives';
    1.57  
    1.58 @@ -775,10 +775,10 @@
    1.59  
    1.60  COMMENT ON TABLE "privilege" IS 'Members rights related to each unit';
    1.61  
    1.62 -COMMENT ON COLUMN "privilege"."admin_manager"        IS 'Grant/revoke admin privileges to/from other users';
    1.63 -COMMENT ON COLUMN "privilege"."unit_manager"         IS 'Create or lock sub units';
    1.64 -COMMENT ON COLUMN "privilege"."area_manager"         IS 'Create or lock areas and set area parameters';
    1.65 -COMMENT ON COLUMN "privilege"."voting_right_manager" IS 'Select which members are allowed to discuss and vote inside the unit';
    1.66 +COMMENT ON COLUMN "privilege"."admin_manager"        IS 'Grant/revoke admin privileges to/from other members';
    1.67 +COMMENT ON COLUMN "privilege"."unit_manager"         IS 'Create and disable sub units';
    1.68 +COMMENT ON COLUMN "privilege"."area_manager"         IS 'Create and disable areas and set area parameters';
    1.69 +COMMENT ON COLUMN "privilege"."voting_right_manager" IS 'Select which members are allowed to discuss and vote within the unit';
    1.70  COMMENT ON COLUMN "privilege"."voting_right"         IS 'Right to discuss and vote';
    1.71  
    1.72  
    1.73 @@ -824,6 +824,7 @@
    1.74  
    1.75  COMMENT ON TABLE "supporter" IS 'Members who support an initiative (conditionally); Frontends must ensure that supporters are not added or removed from fully_frozen or closed initiatives.';
    1.76  
    1.77 +COMMENT ON COLUMN "supporter"."issue_id" IS 'WARNING: No index: For selections use column "initiative_id" and join via table "initiative" where neccessary';
    1.78  COMMENT ON COLUMN "supporter"."draft_id" IS 'Latest seen draft; should always be set by a frontend, but defaults to current draft of the initiative (implemented by trigger "default_for_draft_id")';
    1.79  
    1.80  
    1.81 @@ -956,6 +957,7 @@
    1.82  
    1.83  COMMENT ON TABLE "direct_supporter_snapshot" IS 'Snapshot of supporters of initiatives (weight is stored in "direct_interest_snapshot")';
    1.84  
    1.85 +COMMENT ON COLUMN "direct_supporter_snapshot"."issue_id"  IS 'WARNING: No index: For selections use column "initiative_id" and join via table "initiative" where neccessary';
    1.86  COMMENT ON COLUMN "direct_supporter_snapshot"."event"     IS 'Reason for snapshot, see "snapshot_event" type for details';
    1.87  COMMENT ON COLUMN "direct_supporter_snapshot"."informed"  IS 'Supporter has seen the latest draft of the initiative';
    1.88  COMMENT ON COLUMN "direct_supporter_snapshot"."satisfied" IS 'Supporter has no "critical_opinion"s';
    1.89 @@ -979,7 +981,7 @@
    1.90  
    1.91  COMMENT ON TABLE "direct_voter" IS 'Members having directly voted for/against initiatives of an issue; Frontends must ensure that no voters are added or removed to/from this table when the issue has been closed.';
    1.92  
    1.93 -COMMENT ON COLUMN "direct_voter"."weight"     IS 'Weight of member (1 or higher) according to "delegating_voter" table';
    1.94 +COMMENT ON COLUMN "direct_voter"."weight" IS 'Weight of member (1 or higher) according to "delegating_voter" table';
    1.95  
    1.96  
    1.97  CREATE TABLE "delegating_voter" (
    1.98 @@ -1010,7 +1012,8 @@
    1.99  
   1.100  COMMENT ON TABLE "vote" IS 'Manual and delegated votes without abstentions; Frontends must ensure that no votes are added modified or removed when the issue has been closed.';
   1.101  
   1.102 -COMMENT ON COLUMN "vote"."grade" IS 'Values smaller than zero mean reject, values greater than zero mean acceptance, zero or missing row means abstention. Preferences are expressed by different positive or negative numbers.';
   1.103 +COMMENT ON COLUMN "vote"."issue_id" IS 'WARNING: No index: For selections use column "initiative_id" and join via table "initiative" where neccessary';
   1.104 +COMMENT ON COLUMN "vote"."grade"    IS 'Values smaller than zero mean reject, values greater than zero mean acceptance, zero or missing row means abstention. Preferences are expressed by different positive or negative numbers.';
   1.105  
   1.106  
   1.107  CREATE TABLE "issue_comment" (
   1.108 @@ -1138,6 +1141,7 @@
   1.109              "initiative_id" NOTNULL AND
   1.110              "draft_id"      ISNULL  AND
   1.111              "suggestion_id" NOTNULL )) );
   1.112 +-- TODO: indicies
   1.113  
   1.114  COMMENT ON TABLE "event" IS 'Event table, automatically filled by triggers';
   1.115  

Impressum / About Us