liquid_feedback_core
diff core.sql @ 465:49fbad89371d
Changed table/column order
author | jbe |
---|---|
date | Sat Mar 26 00:22:13 2016 +0100 (2016-03-26) |
parents | 913f4d0b1e6e |
children | c6344e3a3c4a |
line diff
1.1 --- a/core.sql Fri Mar 25 23:35:25 2016 +0100 1.2 +++ b/core.sql Sat Mar 26 00:22:13 2016 +0100 1.3 @@ -475,6 +475,15 @@ 1.4 COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege"'; 1.5 1.6 1.7 +CREATE TABLE "subscription" ( 1.8 + PRIMARY KEY ("member_id", "unit_id"), 1.9 + "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.10 + "unit_id" INT4 REFERENCES "unit" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); 1.11 +CREATE INDEX "subscription_unit_id_idx" ON "subscription" ("unit_id"); 1.12 + 1.13 +COMMENT ON TABLE "subscription" IS 'An entry in this table denotes that the member wishes to receive notifications regardless of his/her privileges in the given unit'; 1.14 + 1.15 + 1.16 CREATE TABLE "unit_setting" ( 1.17 PRIMARY KEY ("member_id", "key", "unit_id"), 1.18 "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.19 @@ -512,6 +521,15 @@ 1.20 COMMENT ON COLUMN "area"."member_weight" IS 'Same as "direct_member_count" but respecting delegations'; 1.21 1.22 1.23 +CREATE TABLE "ignored_area" ( 1.24 + PRIMARY KEY ("member_id", "area_id"), 1.25 + "member_id" INT4 REFERENCES "unit" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.26 + "area_id" INT4 REFERENCES "area" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); 1.27 +CREATE INDEX "ignored_area_area_id_idx" ON "ignored_area" ("area_id"); 1.28 + 1.29 +COMMENT ON TABLE "ignored_area" IS 'An entry in this table denotes that the member does not wish to receive notifications for the given subject area unless he/she declared interested in a particular issue'; 1.30 + 1.31 + 1.32 CREATE TABLE "area_setting" ( 1.33 PRIMARY KEY ("member_id", "key", "area_id"), 1.34 "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.35 @@ -778,10 +796,10 @@ 1.36 1.37 1.38 CREATE TABLE "ignored_initiative" ( 1.39 - PRIMARY KEY ("initiative_id", "member_id"), 1.40 - "initiative_id" INT4 REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.41 - "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); 1.42 -CREATE INDEX "ignored_initiative_member_id_idx" ON "ignored_initiative" ("member_id"); 1.43 + PRIMARY KEY ("member_id", "initiative_id"), 1.44 + "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.45 + "initiative_id" INT4 REFERENCES "initiative" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); 1.46 +CREATE INDEX "ignored_initiative_initiative_id_idx" ON "ignored_initiative" ("initiative_id"); 1.47 1.48 COMMENT ON TABLE "ignored_initiative" IS 'Possibility to filter initiatives'; 1.49 1.50 @@ -918,24 +936,6 @@ 1.51 COMMENT ON COLUMN "privilege"."polling_right" IS 'Right to create issues with policies having the "policy"."polling" flag set, and to add initiatives having the "initiative"."polling" flag set to those issues'; 1.52 1.53 1.54 -CREATE TABLE "subscription" ( 1.55 - PRIMARY KEY ("unit_id", "member_id"), 1.56 - "unit_id" INT4 REFERENCES "unit" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.57 - "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); 1.58 -CREATE INDEX "subscription_member_id_idx" ON "subscription" ("member_id"); 1.59 - 1.60 -COMMENT ON TABLE "subscription" IS 'An entry in this table denotes that the member wishes to receive notifications regardless of his/her privileges in the given unit'; 1.61 - 1.62 - 1.63 -CREATE TABLE "ignored_area" ( 1.64 - PRIMARY KEY ("area_id", "member_id"), 1.65 - "area_id" INT4 REFERENCES "area" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.66 - "member_id" INT4 REFERENCES "unit" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); 1.67 -CREATE INDEX "ignored_area_member_id_idx" ON "ignored_area" ("member_id"); 1.68 - 1.69 -COMMENT ON TABLE "ignored_area" IS 'An entry in this table denotes that the member does not wish to receive notifications for the given subject area unless he/she declared interested in a particular issue'; 1.70 - 1.71 - 1.72 CREATE TABLE "membership" ( 1.73 PRIMARY KEY ("area_id", "member_id"), 1.74 "area_id" INT4 REFERENCES "area" ("id") ON DELETE CASCADE ON UPDATE CASCADE,