# HG changeset patch # User jbe # Date 1505570011 -7200 # Node ID deabd90adae8cdbcd2cf36ef4f0301ac34a5af58 # Parent 48ea1c3099284fa7bb82c0d0877f6534f5437083 Renamed "region" (for "unit" and "area") to "location" diff -r 48ea1c309928 -r deabd90adae8 core.sql --- a/core.sql Tue Sep 12 16:54:26 2017 +0200 +++ b/core.sql Sat Sep 16 15:53:31 2017 +0200 @@ -575,12 +575,12 @@ "description" TEXT NOT NULL DEFAULT '', "external_reference" TEXT, "member_count" INT4, - "region" JSONB, + "location" JSONB, "text_search_data" TSVECTOR ); CREATE INDEX "unit_root_idx" ON "unit" ("id") WHERE "parent_id" ISNULL; CREATE INDEX "unit_parent_id_idx" ON "unit" ("parent_id"); CREATE INDEX "unit_active_idx" ON "unit" ("active"); -CREATE INDEX "unit_region_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("region"))); +CREATE INDEX "unit_location_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("location"))); CREATE INDEX "unit_text_search_data_idx" ON "unit" USING gin ("text_search_data"); CREATE TRIGGER "update_text_search_data" BEFORE INSERT OR UPDATE ON "unit" @@ -594,7 +594,7 @@ COMMENT ON COLUMN "unit"."active" IS 'TRUE means new issues can be created in areas of this unit'; COMMENT ON COLUMN "unit"."external_reference" IS 'Opaque data field to store an external reference'; COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege" (only active members counted)'; -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'; +COMMENT ON COLUMN "unit"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; CREATE TABLE "subscription" ( @@ -621,10 +621,10 @@ "quorum_den" INT4 CHECK ("quorum_den" > 0), "issue_quorum" INT4, "external_reference" TEXT, - "region" JSONB, + "location" JSONB, "text_search_data" TSVECTOR ); CREATE INDEX "area_active_idx" ON "area" ("active"); -CREATE INDEX "area_region_idx" ON "area" USING gist ((GeoJSON_to_ecluster("region"))); +CREATE INDEX "area_location_idx" ON "area" USING gist ((GeoJSON_to_ecluster("location"))); CREATE INDEX "area_text_search_data_idx" ON "area" USING gin ("text_search_data"); CREATE TRIGGER "update_text_search_data" BEFORE INSERT OR UPDATE ON "area" @@ -643,7 +643,7 @@ 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)'; 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"'; COMMENT ON COLUMN "area"."external_reference" IS 'Opaque data field to store an external reference'; -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'; +COMMENT ON COLUMN "area"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; CREATE TABLE "ignored_area" ( diff -r 48ea1c309928 -r deabd90adae8 update/core-update.v3.2.2-v4.0.0.sql --- a/update/core-update.v3.2.2-v4.0.0.sql Tue Sep 12 16:54:26 2017 +0200 +++ b/update/core-update.v3.2.2-v4.0.0.sql Sat Sep 16 15:53:31 2017 +0200 @@ -441,12 +441,12 @@ COMMENT ON COLUMN "policy"."initiative_quorum_den" IS 'Denominator of satisfied supporter quorum to be reached by an initiative to be "admitted" for voting'; -ALTER TABLE "unit" ADD COLUMN "region" JSONB; - -CREATE INDEX "unit_region_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("region"))); +ALTER TABLE "unit" ADD COLUMN "location" JSONB; + +CREATE INDEX "unit_location_idx" ON "unit" USING gist ((GeoJSON_to_ecluster("location"))); COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege" (only active members counted)'; -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'; +COMMENT ON COLUMN "unit"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; DROP INDEX "area_unit_id_idx"; @@ -459,12 +459,12 @@ ALTER TABLE "area" ADD COLUMN "quorum_factor" NUMERIC NOT NULL DEFAULT 2 CHECK ("quorum_factor" >= 1); ALTER TABLE "area" ADD COLUMN "quorum_den" INT4 CHECK ("quorum_den" > 0); ALTER TABLE "area" ADD COLUMN "issue_quorum" INT4; -ALTER TABLE "area" ADD COLUMN "region" JSONB; +ALTER TABLE "area" ADD COLUMN "location" JSONB; ALTER TABLE "area" DROP COLUMN "direct_member_count"; ALTER TABLE "area" DROP COLUMN "member_weight"; -CREATE INDEX "area_region_idx" ON "area" USING gist ((GeoJSON_to_ecluster("region"))); +CREATE INDEX "area_location_idx" ON "area" USING gist ((GeoJSON_to_ecluster("location"))); COMMENT ON COLUMN "area"."quorum_standard" IS 'Parameter for dynamic issue quorum: default quorum'; COMMENT ON COLUMN "area"."quorum_issues" IS 'Parameter for dynamic issue quorum: number of open issues for default quorum'; @@ -474,7 +474,7 @@ 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)'; 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"'; COMMENT ON COLUMN "area"."external_reference" IS 'Opaque data field to store an external reference'; -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'; +COMMENT ON COLUMN "area"."location" IS 'Geographic location on earth as GeoJSON object indicating valid coordinates for initiatives of issues with this policy'; CREATE TABLE "snapshot" (