# HG changeset patch # User jbe # Date 1263121200 -3600 # Node ID ac7836ac00d9748055d7fa731d25048ce162d1f1 # Parent fd9295e23be445e3636f4b9aea9c273ae75094dc 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") diff -r fd9295e23be4 -r ac7836ac00d9 core.sql --- a/core.sql Mon Jan 04 12:00:00 2010 +0100 +++ b/core.sql Sun Jan 10 12:00:00 2010 +0100 @@ -6,7 +6,7 @@ BEGIN; CREATE VIEW "liquid_feedback_version" AS - SELECT * FROM (VALUES ('beta14', NULL, NULL, NULL)) + SELECT * FROM (VALUES ('beta15', NULL, NULL, NULL)) AS "subquery"("string", "major", "minor", "revision"); @@ -354,6 +354,7 @@ "discussion_url" TEXT, "created" TIMESTAMPTZ NOT NULL DEFAULT now(), "revoked" TIMESTAMPTZ, + "suggested_initiative_id" INT4 REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE, "admitted" BOOLEAN, "supporter_count" INT4, "informed_supporter_count" INT4, @@ -364,6 +365,8 @@ "agreed" BOOLEAN, "rank" INT4, "text_search_data" TSVECTOR, + CONSTRAINT "non_revoked_initiatives_cant_suggest_other" + CHECK ("revoked" NOTNULL OR "suggested_initiative_id" ISNULL), CONSTRAINT "revoked_initiatives_cant_be_admitted" CHECK ("revoked" ISNULL OR "admitted" ISNULL), CONSTRAINT "non_admitted_initiatives_cant_contain_voting_results" @@ -483,12 +486,12 @@ PRIMARY KEY ("initiative_id", "member_id"), "initiative_id" INT4 REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE, "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, - "accepted" BOOLEAN NOT NULL DEFAULT TRUE ); + "accepted" BOOLEAN ); CREATE INDEX "initiator_member_id_idx" ON "initiator" ("member_id"); 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.'; -COMMENT ON COLUMN "initiator"."accepted" IS 'If "accepted" = FALSE, then the member was invited to be a co-initiator, but has not answered yet.'; +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.'; CREATE TABLE "supporter" ( @@ -2152,6 +2155,7 @@ SELECT * FROM "initiative" WHERE "issue_id" = "issue_id_p" LOOP IF + "initiative_row"."revoked" ISNULL AND "initiative_row"."satisfied_supporter_count" > 0 AND "initiative_row"."satisfied_supporter_count" * "policy_row"."initiative_quorum_den" >=