liquid_feedback_core

changeset 14:ac7836ac00d9 beta15

Version beta15

Bugfix: Revoked initiatives will never be admitted

Possibility to recommend another initiative to support when revoking an initiative

Allow "initiator"."accepted" to be NULL (NULL means "no answer yet", while FALSE means "rejected")
author jbe
date Sun Jan 10 12:00:00 2010 +0100 (2010-01-10)
parents fd9295e23be4
children 6f6ec6b5eee9
files core.sql
line diff
     1.1 --- a/core.sql	Mon Jan 04 12:00:00 2010 +0100
     1.2 +++ b/core.sql	Sun Jan 10 12:00:00 2010 +0100
     1.3 @@ -6,7 +6,7 @@
     1.4  BEGIN;
     1.5  
     1.6  CREATE VIEW "liquid_feedback_version" AS
     1.7 -  SELECT * FROM (VALUES ('beta14', NULL, NULL, NULL))
     1.8 +  SELECT * FROM (VALUES ('beta15', NULL, NULL, NULL))
     1.9    AS "subquery"("string", "major", "minor", "revision");
    1.10  
    1.11  
    1.12 @@ -354,6 +354,7 @@
    1.13          "discussion_url"        TEXT,
    1.14          "created"               TIMESTAMPTZ     NOT NULL DEFAULT now(),
    1.15          "revoked"               TIMESTAMPTZ,
    1.16 +        "suggested_initiative_id" INT4          REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
    1.17          "admitted"              BOOLEAN,
    1.18          "supporter_count"                    INT4,
    1.19          "informed_supporter_count"           INT4,
    1.20 @@ -364,6 +365,8 @@
    1.21          "agreed"                BOOLEAN,
    1.22          "rank"                  INT4,
    1.23          "text_search_data"      TSVECTOR,
    1.24 +        CONSTRAINT "non_revoked_initiatives_cant_suggest_other"
    1.25 +          CHECK ("revoked" NOTNULL OR "suggested_initiative_id" ISNULL),
    1.26          CONSTRAINT "revoked_initiatives_cant_be_admitted"
    1.27            CHECK ("revoked" ISNULL OR "admitted" ISNULL),
    1.28          CONSTRAINT "non_admitted_initiatives_cant_contain_voting_results"
    1.29 @@ -483,12 +486,12 @@
    1.30          PRIMARY KEY ("initiative_id", "member_id"),
    1.31          "initiative_id"         INT4            REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
    1.32          "member_id"             INT4            REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
    1.33 -        "accepted"              BOOLEAN         NOT NULL DEFAULT TRUE );
    1.34 +        "accepted"              BOOLEAN );
    1.35  CREATE INDEX "initiator_member_id_idx" ON "initiator" ("member_id");
    1.36  
    1.37  COMMENT ON TABLE "initiator" IS 'Members who are allowed to post new drafts; Frontends must ensure that initiators are not added or removed from half_frozen, fully_frozen or closed initiatives.';
    1.38  
    1.39 -COMMENT ON COLUMN "initiator"."accepted" IS 'If "accepted" = FALSE, then the member was invited to be a co-initiator, but has not answered yet.';
    1.40 +COMMENT ON COLUMN "initiator"."accepted" IS 'If "accepted" is NULL, then the member was invited to be a co-initiator, but has not answered yet. If it is TRUE, the member has accepted the invitation, if it is FALSE, the member has rejected the invitation.';
    1.41  
    1.42  
    1.43  CREATE TABLE "supporter" (
    1.44 @@ -2152,6 +2155,7 @@
    1.45          SELECT * FROM "initiative" WHERE "issue_id" = "issue_id_p"
    1.46        LOOP
    1.47          IF
    1.48 +          "initiative_row"."revoked" ISNULL AND
    1.49            "initiative_row"."satisfied_supporter_count" > 0 AND
    1.50            "initiative_row"."satisfied_supporter_count" *
    1.51            "policy_row"."initiative_quorum_den" >=

Impressum / About Us