liquid_feedback_core
changeset 551:deabd90adae8
Renamed "region" (for "unit" and "area") to "location"
author | jbe |
---|---|
date | Sat Sep 16 15:53:31 2017 +0200 (2017-09-16) |
parents | 48ea1c309928 |
children | a676d305502f |
files | core.sql update/core-update.v3.2.2-v4.0.0.sql |
line diff
1.1 --- a/core.sql Tue Sep 12 16:54:26 2017 +0200 1.2 +++ b/core.sql Sat Sep 16 15:53:31 2017 +0200 1.3 @@ -575,12 +575,12 @@ 1.4 "description" TEXT NOT NULL DEFAULT '', 1.5 "external_reference" TEXT, 1.6 "member_count" INT4, 1.7 - "region" JSONB, 1.8 + "location" JSONB, 1.9 "text_search_data" TSVECTOR ); 1.10 CREATE INDEX "unit_root_idx" ON "unit" ("id") WHERE "parent_id" ISNULL; 1.11 CREATE INDEX "unit_parent_id_idx" ON "unit" ("parent_id"); 1.12 CREATE INDEX "unit_active_idx" ON "unit" ("active"); 1.13 -CREATE INDEX "unit_region_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("region"))); 1.14 +CREATE INDEX "unit_location_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("location"))); 1.15 CREATE INDEX "unit_text_search_data_idx" ON "unit" USING gin ("text_search_data"); 1.16 CREATE TRIGGER "update_text_search_data" 1.17 BEFORE INSERT OR UPDATE ON "unit" 1.18 @@ -594,7 +594,7 @@ 1.19 COMMENT ON COLUMN "unit"."active" IS 'TRUE means new issues can be created in areas of this unit'; 1.20 COMMENT ON COLUMN "unit"."external_reference" IS 'Opaque data field to store an external reference'; 1.21 COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege" (only active members counted)'; 1.22 -COMMENT ON COLUMN "unit"."region" IS 'Scattered (or hollow) polygon represented as an array of polygons indicating valid coordinates for initiatives of issues with this policy'; 1.23 +COMMENT ON COLUMN "unit"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; 1.24 1.25 1.26 CREATE TABLE "subscription" ( 1.27 @@ -621,10 +621,10 @@ 1.28 "quorum_den" INT4 CHECK ("quorum_den" > 0), 1.29 "issue_quorum" INT4, 1.30 "external_reference" TEXT, 1.31 - "region" JSONB, 1.32 + "location" JSONB, 1.33 "text_search_data" TSVECTOR ); 1.34 CREATE INDEX "area_active_idx" ON "area" ("active"); 1.35 -CREATE INDEX "area_region_idx" ON "area" USING gist ((GeoJSON_to_ecluster("region"))); 1.36 +CREATE INDEX "area_location_idx" ON "area" USING gist ((GeoJSON_to_ecluster("location"))); 1.37 CREATE INDEX "area_text_search_data_idx" ON "area" USING gin ("text_search_data"); 1.38 CREATE TRIGGER "update_text_search_data" 1.39 BEFORE INSERT OR UPDATE ON "area" 1.40 @@ -643,7 +643,7 @@ 1.41 COMMENT ON COLUMN "area"."quorum_den" IS 'Parameter for dynamic issue quorum: when set, dynamic quorum is multiplied with "issue"."population" and divided by "quorum_den" (and then rounded up)'; 1.42 COMMENT ON COLUMN "area"."issue_quorum" IS 'Additional dynamic issue quorum based on the number of open accepted issues; automatically calculated by function "issue_admission"'; 1.43 COMMENT ON COLUMN "area"."external_reference" IS 'Opaque data field to store an external reference'; 1.44 -COMMENT ON COLUMN "area"."region" IS 'Scattered (or hollow) polygon represented as an array of polygons indicating valid coordinates for initiatives of issues with this policy'; 1.45 +COMMENT ON COLUMN "area"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; 1.46 1.47 1.48 CREATE TABLE "ignored_area" (
2.1 --- a/update/core-update.v3.2.2-v4.0.0.sql Tue Sep 12 16:54:26 2017 +0200 2.2 +++ b/update/core-update.v3.2.2-v4.0.0.sql Sat Sep 16 15:53:31 2017 +0200 2.3 @@ -441,12 +441,12 @@ 2.4 COMMENT ON COLUMN "policy"."initiative_quorum_den" IS 'Denominator of satisfied supporter quorum to be reached by an initiative to be "admitted" for voting'; 2.5 2.6 2.7 -ALTER TABLE "unit" ADD COLUMN "region" JSONB; 2.8 - 2.9 -CREATE INDEX "unit_region_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("region"))); 2.10 +ALTER TABLE "unit" ADD COLUMN "location" JSONB; 2.11 + 2.12 +CREATE INDEX "unit_location_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("location"))); 2.13 2.14 COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege" (only active members counted)'; 2.15 -COMMENT ON COLUMN "unit"."region" IS 'Scattered (or hollow) polygon represented as an array of polygons indicating valid coordinates for initiatives of issues with this policy'; 2.16 +COMMENT ON COLUMN "unit"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; 2.17 2.18 2.19 DROP INDEX "area_unit_id_idx"; 2.20 @@ -459,12 +459,12 @@ 2.21 ALTER TABLE "area" ADD COLUMN "quorum_factor" NUMERIC NOT NULL DEFAULT 2 CHECK ("quorum_factor" >= 1); 2.22 ALTER TABLE "area" ADD COLUMN "quorum_den" INT4 CHECK ("quorum_den" > 0); 2.23 ALTER TABLE "area" ADD COLUMN "issue_quorum" INT4; 2.24 -ALTER TABLE "area" ADD COLUMN "region" JSONB; 2.25 +ALTER TABLE "area" ADD COLUMN "location" JSONB; 2.26 2.27 ALTER TABLE "area" DROP COLUMN "direct_member_count"; 2.28 ALTER TABLE "area" DROP COLUMN "member_weight"; 2.29 2.30 -CREATE INDEX "area_region_idx" ON "area" USING gist ((GeoJSON_to_ecluster("region"))); 2.31 +CREATE INDEX "area_location_idx" ON "area" USING gist ((GeoJSON_to_ecluster("location"))); 2.32 2.33 COMMENT ON COLUMN "area"."quorum_standard" IS 'Parameter for dynamic issue quorum: default quorum'; 2.34 COMMENT ON COLUMN "area"."quorum_issues" IS 'Parameter for dynamic issue quorum: number of open issues for default quorum'; 2.35 @@ -474,7 +474,7 @@ 2.36 COMMENT ON COLUMN "area"."quorum_den" IS 'Parameter for dynamic issue quorum: when set, dynamic quorum is multiplied with "issue"."population" and divided by "quorum_den" (and then rounded up)'; 2.37 COMMENT ON COLUMN "area"."issue_quorum" IS 'Additional dynamic issue quorum based on the number of open accepted issues; automatically calculated by function "issue_admission"'; 2.38 COMMENT ON COLUMN "area"."external_reference" IS 'Opaque data field to store an external reference'; 2.39 -COMMENT ON COLUMN "area"."region" IS 'Scattered (or hollow) polygon represented as an array of polygons indicating valid coordinates for initiatives of issues with this policy'; 2.40 +COMMENT ON COLUMN "area"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; 2.41 2.42 2.43 CREATE TABLE "snapshot" (