liquid_feedback_core
changeset 616:ae53fc96c953
Added JSONB column "attr" to table "unit" for extended attributes of any kind
author | jbe |
---|---|
date | Tue Jul 28 18:57:20 2020 +0200 (2020-07-28) |
parents | 5ae68278492f |
children | 8e9d0878b5dc |
files | core.sql update/core-update.v4.2.0-v4.2.1.sql |
line diff
1.1 --- a/core.sql Sun May 17 13:56:43 2020 +0200 1.2 +++ b/core.sql Tue Jul 28 18:57:20 2020 +0200 1.3 @@ -634,7 +634,8 @@ 1.4 "active" BOOLEAN NOT NULL DEFAULT TRUE, 1.5 "name" TEXT NOT NULL, -- full text search 1.6 "description" TEXT NOT NULL DEFAULT '', -- full text search 1.7 - "external_reference" TEXT, 1.8 + "attr" JSONB NOT NULL DEFAULT '{}' CHECK (jsonb_typeof("attr") = 'object'), 1.9 + "external_reference" TEXT, -- TODO: move external_reference to attr (also for area, issue, etc.) 1.10 "member_count" INT4, 1.11 "member_weight" INT4, 1.12 "location" JSONB ); 1.13 @@ -647,6 +648,7 @@ 1.14 1.15 COMMENT ON COLUMN "unit"."parent_id" IS 'Parent id of tree node; Multiple roots allowed'; 1.16 COMMENT ON COLUMN "unit"."active" IS 'TRUE means new issues can be created in areas of this unit'; 1.17 +COMMENT ON COLUMN "unit"."attr" IS 'Opaque data structure to store any extended attributes used by frontend or middleware'; 1.18 COMMENT ON COLUMN "unit"."external_reference" IS 'Opaque data field to store an external reference'; 1.19 COMMENT ON COLUMN "unit"."member_count" IS 'Count of members as determined by column "voting_right" in table "privilege" (only active members counted)'; 1.20 COMMENT ON COLUMN "unit"."member_weight" IS 'Sum of active members'' voting weight';
2.1 --- a/update/core-update.v4.2.0-v4.2.1.sql Sun May 17 13:56:43 2020 +0200 2.2 +++ b/update/core-update.v4.2.0-v4.2.1.sql Tue Jul 28 18:57:20 2020 +0200 2.3 @@ -4,6 +4,9 @@ 2.4 2.5 BEGIN; 2.6 2.7 +ALTER TABLE "unit" ADD COLUMN "attr" JSONB NOT NULL DEFAULT '{}' CHECK (jsonb_typeof("attr") = 'object'); 2.8 +COMMENT ON COLUMN "unit"."attr" IS 'Opaque data structure to store any extended attributes used by frontend or middleware'; 2.9 + 2.10 ALTER TABLE "unit" ADD COLUMN "member_weight" INT4; 2.11 COMMENT ON COLUMN "unit"."member_weight" IS 'Sum of active members'' voting weight'; 2.12