liquid_feedback_core
changeset 444:d14513809147
Added support for storing external references (opaque data field) to "unit", "area", "issue", "initiative", "draft", and "suggestion" tables
author | jbe |
---|---|
date | Sat Jul 18 17:12:54 2015 +0200 (2015-07-18) |
parents | 1d779f37bd98 |
children | fbb49f35b4e1 |
files | LICENSE core.sql update/core-update.v3.0.4-v3.0.5.sql |
line diff
1.1 --- a/LICENSE Fri Apr 03 14:49:54 2015 +0200 1.2 +++ b/LICENSE Sat Jul 18 17:12:54 2015 +0200 1.3 @@ -1,4 +1,4 @@ 1.4 -Copyright (c) 2009-2014 Public Software Group e. V., Berlin, Germany 1.5 +Copyright (c) 2009-2015 Public Software Group e. V., Berlin, Germany 1.6 1.7 Permission is hereby granted, free of charge, to any person obtaining a 1.8 copy of this software and associated documentation files (the "Software"),
2.1 --- a/core.sql Fri Apr 03 14:49:54 2015 +0200 2.2 +++ b/core.sql Sat Jul 18 17:12:54 2015 +0200 2.3 @@ -7,7 +7,7 @@ 2.4 BEGIN; 2.5 2.6 CREATE VIEW "liquid_feedback_version" AS 2.7 - SELECT * FROM (VALUES ('3.0.4', 3, 0, 4)) 2.8 + SELECT * FROM (VALUES ('3.0.5', 3, 0, 5)) 2.9 AS "subquery"("string", "major", "minor", "revision"); 2.10 2.11 2.12 @@ -460,6 +460,7 @@ 2.13 "active" BOOLEAN NOT NULL DEFAULT TRUE, 2.14 "name" TEXT NOT NULL, 2.15 "description" TEXT NOT NULL DEFAULT '', 2.16 + "external_reference" TEXT, 2.17 "member_count" INT4, 2.18 "text_search_data" TSVECTOR ); 2.19 CREATE INDEX "unit_root_idx" ON "unit" ("id") WHERE "parent_id" ISNULL; 2.20 @@ -474,9 +475,10 @@ 2.21 2.22 COMMENT ON TABLE "unit" IS 'Organizational units organized as trees; Delegations are not inherited through these trees.'; 2.23 2.24 -COMMENT ON COLUMN "unit"."parent_id" IS 'Parent id of tree node; Multiple roots allowed'; 2.25 -COMMENT ON COLUMN "unit"."active" IS 'TRUE means new issues can be created in areas of this unit'; 2.26 -COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege"'; 2.27 +COMMENT ON COLUMN "unit"."parent_id" IS 'Parent id of tree node; Multiple roots allowed'; 2.28 +COMMENT ON COLUMN "unit"."active" IS 'TRUE means new issues can be created in areas of this unit'; 2.29 +COMMENT ON COLUMN "unit"."external_reference" IS 'Opaque data field to store an external reference'; 2.30 +COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege"'; 2.31 2.32 2.33 CREATE TABLE "unit_setting" ( 2.34 @@ -495,6 +497,7 @@ 2.35 "active" BOOLEAN NOT NULL DEFAULT TRUE, 2.36 "name" TEXT NOT NULL, 2.37 "description" TEXT NOT NULL DEFAULT '', 2.38 + "external_reference" TEXT, 2.39 "direct_member_count" INT4, 2.40 "member_weight" INT4, 2.41 "text_search_data" TSVECTOR ); 2.42 @@ -510,6 +513,7 @@ 2.43 COMMENT ON TABLE "area" IS 'Subject areas'; 2.44 2.45 COMMENT ON COLUMN "area"."active" IS 'TRUE means new issues can be created in this area'; 2.46 +COMMENT ON COLUMN "area"."external_reference" IS 'Opaque data field to store an external reference'; 2.47 COMMENT ON COLUMN "area"."direct_member_count" IS 'Number of active members of that area (ignoring their weight), as calculated from view "area_member_count"'; 2.48 COMMENT ON COLUMN "area"."member_weight" IS 'Same as "direct_member_count" but respecting delegations'; 2.49 2.50 @@ -559,6 +563,7 @@ 2.51 "area_id" INT4 NOT NULL REFERENCES "area" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 2.52 "policy_id" INT4 NOT NULL REFERENCES "policy" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, 2.53 "admin_notice" TEXT, 2.54 + "external_reference" TEXT, 2.55 "state" "issue_state" NOT NULL DEFAULT 'admission', 2.56 "phase_finished" TIMESTAMPTZ, 2.57 "created" TIMESTAMPTZ NOT NULL DEFAULT now(), 2.58 @@ -626,6 +631,7 @@ 2.59 COMMENT ON TABLE "issue" IS 'Groups of initiatives'; 2.60 2.61 COMMENT ON COLUMN "issue"."admin_notice" IS 'Public notice by admin to explain manual interventions, or to announce corrections'; 2.62 +COMMENT ON COLUMN "issue"."external_reference" IS 'Opaque data field to store an external reference'; 2.63 COMMENT ON COLUMN "issue"."phase_finished" IS 'Set to a value NOTNULL, if the current phase has finished, but calculations are pending; No changes in this issue shall be made by the frontend or API when this value is set'; 2.64 COMMENT ON COLUMN "issue"."accepted" IS 'Point in time, when one initiative of issue reached the "issue_quorum"'; 2.65 COMMENT ON COLUMN "issue"."half_frozen" IS 'Point in time, when "discussion_time" has elapsed; Frontends must ensure that for half_frozen issues a) initiatives are not revoked, b) no new drafts are created, c) no initiators are added or removed.'; 2.66 @@ -676,6 +682,7 @@ 2.67 "revoked" TIMESTAMPTZ, 2.68 "revoked_by_member_id" INT4 REFERENCES "member" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, 2.69 "suggested_initiative_id" INT4 REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 2.70 + "external_reference" TEXT, 2.71 "admitted" BOOLEAN, 2.72 "supporter_count" INT4, 2.73 "informed_supporter_count" INT4, 2.74 @@ -735,6 +742,7 @@ 2.75 COMMENT ON COLUMN "initiative"."discussion_url" IS 'URL pointing to a discussion platform for this initiative'; 2.76 COMMENT ON COLUMN "initiative"."revoked" IS 'Point in time, when one initiator decided to revoke the initiative'; 2.77 COMMENT ON COLUMN "initiative"."revoked_by_member_id" IS 'Member, who decided to revoke the initiative'; 2.78 +COMMENT ON COLUMN "initiative"."external_reference" IS 'Opaque data field to store an external reference'; 2.79 COMMENT ON COLUMN "initiative"."admitted" IS 'TRUE, if initiative reaches the "initiative_quorum" when freezing the issue'; 2.80 COMMENT ON COLUMN "initiative"."supporter_count" IS 'Calculated from table "direct_supporter_snapshot"'; 2.81 COMMENT ON COLUMN "initiative"."informed_supporter_count" IS 'Calculated from table "direct_supporter_snapshot"'; 2.82 @@ -802,6 +810,7 @@ 2.83 "author_id" INT4 NOT NULL REFERENCES "member" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, 2.84 "formatting_engine" TEXT, 2.85 "content" TEXT NOT NULL, 2.86 + "external_reference" TEXT, 2.87 "text_search_data" TSVECTOR ); 2.88 CREATE INDEX "draft_created_idx" ON "draft" ("created"); 2.89 CREATE INDEX "draft_author_id_created_idx" ON "draft" ("author_id", "created"); 2.90 @@ -813,8 +822,9 @@ 2.91 2.92 COMMENT ON TABLE "draft" IS 'Drafts of initiatives to solve issues; Frontends must ensure that new drafts for initiatives of half_frozen, fully_frozen or closed issues can''t be created.'; 2.93 2.94 -COMMENT ON COLUMN "draft"."formatting_engine" IS 'Allows different formatting engines (i.e. wiki formats) to be used'; 2.95 -COMMENT ON COLUMN "draft"."content" IS 'Text of the draft in a format depending on the field "formatting_engine"'; 2.96 +COMMENT ON COLUMN "draft"."formatting_engine" IS 'Allows different formatting engines (i.e. wiki formats) to be used'; 2.97 +COMMENT ON COLUMN "draft"."content" IS 'Text of the draft in a format depending on the field "formatting_engine"'; 2.98 +COMMENT ON COLUMN "draft"."external_reference" IS 'Opaque data field to store an external reference'; 2.99 2.100 2.101 CREATE TABLE "rendered_draft" ( 2.102 @@ -837,6 +847,7 @@ 2.103 "name" TEXT NOT NULL, 2.104 "formatting_engine" TEXT, 2.105 "content" TEXT NOT NULL DEFAULT '', 2.106 + "external_reference" TEXT, 2.107 "text_search_data" TSVECTOR, 2.108 "minus2_unfulfilled_count" INT4, 2.109 "minus2_fulfilled_count" INT4, 2.110 @@ -859,6 +870,7 @@ 2.111 COMMENT ON TABLE "suggestion" IS 'Suggestions to initiators, to change the current draft; must not be deleted explicitly, as they vanish automatically if the last opinion is deleted'; 2.112 2.113 COMMENT ON COLUMN "suggestion"."draft_id" IS 'Draft, which the author has seen when composing the suggestion; should always be set by a frontend, but defaults to current draft of the initiative (implemented by trigger "default_for_draft_id")'; 2.114 +COMMENT ON COLUMN "suggestion"."external_reference" IS 'Opaque data field to store an external reference'; 2.115 COMMENT ON COLUMN "suggestion"."minus2_unfulfilled_count" IS 'Calculated from table "direct_supporter_snapshot", not requiring informed supporters'; 2.116 COMMENT ON COLUMN "suggestion"."minus2_fulfilled_count" IS 'Calculated from table "direct_supporter_snapshot", not requiring informed supporters'; 2.117 COMMENT ON COLUMN "suggestion"."minus1_unfulfilled_count" IS 'Calculated from table "direct_supporter_snapshot", not requiring informed supporters';
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/update/core-update.v3.0.4-v3.0.5.sql Sat Jul 18 17:12:54 2015 +0200 3.3 @@ -0,0 +1,25 @@ 3.4 +BEGIN; 3.5 + 3.6 +CREATE OR REPLACE VIEW "liquid_feedback_version" AS 3.7 + SELECT * FROM (VALUES ('3.0.5', 3, 0, 5)) 3.8 + AS "subquery"("string", "major", "minor", "revision"); 3.9 + 3.10 +ALTER TABLE "unit" ADD COLUMN "external_reference" TEXT; 3.11 +COMMENT ON COLUMN "unit"."external_reference" IS 'Opaque data field to store an external reference'; 3.12 + 3.13 +ALTER TABLE "area" ADD COLUMN "external_reference" TEXT; 3.14 +COMMENT ON COLUMN "area"."external_reference" IS 'Opaque data field to store an external reference'; 3.15 + 3.16 +ALTER TABLE "issue" ADD COLUMN "external_reference" TEXT; 3.17 +COMMENT ON COLUMN "issue"."external_reference" IS 'Opaque data field to store an external reference'; 3.18 + 3.19 +ALTER TABLE "initiative" ADD COLUMN "external_reference" TEXT; 3.20 +COMMENT ON COLUMN "initiative"."external_reference" IS 'Opaque data field to store an external reference'; 3.21 + 3.22 +ALTER TABLE "draft" ADD COLUMN "external_reference" TEXT; 3.23 +COMMENT ON COLUMN "draft"."external_reference" IS 'Opaque data field to store an external reference'; 3.24 + 3.25 +ALTER TABLE "suggestion" ADD COLUMN "external_reference" TEXT; 3.26 +COMMENT ON COLUMN "suggestion"."external_reference" IS 'Opaque data field to store an external reference'; 3.27 + 3.28 +COMMIT;