liquid_feedback_core
diff update/core-update.v2.2.4-v2.2.5.sql @ 389:582d270d2653
Added column "admin_notice" to "issue" table, and value 'canceled_by_admin' to "issue_state" type
author | jbe |
---|---|
date | Sun Aug 11 21:34:58 2013 +0200 (2013-08-11) |
parents | |
children | 992ec266356d |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/update/core-update.v2.2.4-v2.2.5.sql Sun Aug 11 21:34:58 2013 +0200 1.3 @@ -0,0 +1,46 @@ 1.4 +-- NOTICE: The following command cannot be executed within a transaction block 1.5 +-- and must be rolled back manually, if the update fails: 1.6 +ALTER TYPE "issue_state" ADD VALUE 'canceled_by_admin' AFTER 'voting'; 1.7 + 1.8 +BEGIN; 1.9 + 1.10 +CREATE OR REPLACE VIEW "liquid_feedback_version" AS 1.11 + SELECT * FROM (VALUES ('2.2.5', 2, 2, 5)) 1.12 + AS "subquery"("string", "major", "minor", "revision"); 1.13 + 1.14 +ALTER TABLE "issue" ADD COLUMN "admin_notice" TEXT; 1.15 +COMMENT ON COLUMN "issue"."admin_notice" IS 'Public notice by admin to explain manual interventions, or to announce corrections'; 1.16 + 1.17 +ALTER TABLE "issue" DROP CONSTRAINT "valid_state"; 1.18 +ALTER TABLE "issue" ADD 1.19 + CONSTRAINT "valid_state" CHECK ( 1.20 + ( 1.21 + ("accepted" ISNULL AND "half_frozen" ISNULL AND "fully_frozen" ISNULL ) OR 1.22 + ("accepted" NOTNULL AND "half_frozen" ISNULL AND "fully_frozen" ISNULL ) OR 1.23 + ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" ISNULL ) OR 1.24 + ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" NOTNULL) 1.25 + ) AND ( 1.26 + ("state" = 'admission' AND "closed" ISNULL AND "accepted" ISNULL) OR 1.27 + ("state" = 'discussion' AND "closed" ISNULL AND "accepted" NOTNULL AND "half_frozen" ISNULL) OR 1.28 + ("state" = 'verification' AND "closed" ISNULL AND "half_frozen" NOTNULL AND "fully_frozen" ISNULL) OR 1.29 + ("state" = 'voting' AND "closed" ISNULL AND "fully_frozen" NOTNULL) OR 1.30 + ("state" = 'canceled_by_admin' AND "closed" NOTNULL) OR 1.31 + ("state" = 'canceled_revoked_before_accepted' AND "closed" NOTNULL AND "accepted" ISNULL) OR 1.32 + ("state" = 'canceled_issue_not_accepted' AND "closed" NOTNULL AND "accepted" ISNULL) OR 1.33 + ("state" = 'canceled_after_revocation_during_discussion' AND "closed" NOTNULL AND "half_frozen" ISNULL) OR 1.34 + ("state" = 'canceled_after_revocation_during_verification' AND "closed" NOTNULL AND "fully_frozen" ISNULL) OR 1.35 + ("state" = 'canceled_no_initiative_admitted' AND "closed" NOTNULL AND "fully_frozen" NOTNULL AND "closed" = "fully_frozen") OR 1.36 + ("state" = 'finished_without_winner' AND "closed" NOTNULL AND "fully_frozen" NOTNULL AND "closed" != "fully_frozen") OR 1.37 + ("state" = 'finished_with_winner' AND "closed" NOTNULL AND "fully_frozen" NOTNULL AND "closed" != "fully_frozen") 1.38 + )); 1.39 + 1.40 +COMMENT ON TABLE "direct_population_snapshot" IS 'Snapshot of active members having either a "membership" in the "area" or an "interest" in the "issue"; for corrections refer to column "issue_notice" of "issue" table'; 1.41 +COMMENT ON TABLE "direct_population_snapshot" IS 'Delegations increasing the weight of entries in the "direct_population_snapshot" table; for corrections refer to column "issue_notice" of "issue" table'; 1.42 +COMMENT ON TABLE "direct_interest_snapshot" IS 'Snapshot of active members having an "interest" in the "issue"; for corrections refer to column "issue_notice" of "issue" table'; 1.43 +COMMENT ON TABLE "delegating_interest_snapshot" IS 'Delegations increasing the weight of entries in the "direct_interest_snapshot" table; for corrections refer to column "issue_notice" of "issue" table'; 1.44 +COMMENT ON TABLE "direct_supporter_snapshot" IS 'Snapshot of supporters of initiatives (weight is stored in "direct_interest_snapshot"); for corrections refer to column "issue_notice" of "issue" table'; 1.45 +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; for corrections refer to column "issue_notice" of "issue" table'; 1.46 +COMMENT ON TABLE "delegating_voter" IS 'Delegations increasing the weight of entries in the "direct_voter" table; for corrections refer to column "issue_notice" of "issue" table'; 1.47 +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; for corrections refer to column "issue_notice" of "issue" table'; 1.48 + 1.49 +COMMIT;