liquid_feedback_core
diff core.sql @ 253:389200fd973d
Added field "participating_member_id" to result of "delegation_info" function
| author | jbe |
|---|---|
| date | Sun May 20 17:20:50 2012 +0200 (2012-05-20) |
| parents | 7b8966b801e5 |
| children | a1db85ce10ea |
line diff
1.1 --- a/core.sql Tue May 15 23:02:30 2012 +0200 1.2 +++ b/core.sql Sun May 20 17:20:50 2012 +0200 1.3 @@ -7,7 +7,7 @@ 1.4 BEGIN; 1.5 1.6 CREATE VIEW "liquid_feedback_version" AS 1.7 - SELECT * FROM (VALUES ('2.0.9', 2, 0, 9)) 1.8 + SELECT * FROM (VALUES ('2.0.10', 2, 0, 10)) 1.9 AS "subquery"("string", "major", "minor", "revision"); 1.10 1.11 1.12 @@ -2664,7 +2664,8 @@ 1.13 "other_trustee_id" INT4, 1.14 "other_trustee_participation" BOOLEAN, 1.15 "other_trustee_ellipsis" BOOLEAN, 1.16 - "delegation_loop" "delegation_info_loop_type"); 1.17 + "delegation_loop" "delegation_info_loop_type", 1.18 + "participating_member_id" INT4 ); 1.19 1.20 COMMENT ON TYPE "delegation_info_type" IS 'Type of result returned by "delegation_info" function; For meaning of "participation" check comment on "delegation_chain_row" type'; 1.21 1.22 @@ -2677,6 +2678,7 @@ 1.23 COMMENT ON COLUMN "delegation_info_type"."other_trustee_participation" IS 'Another trustee is participating (redundant field: if "other_trustee_id" is set, then "other_trustee_participation" is always TRUE, else "other_trustee_participation" is NULL)'; 1.24 COMMENT ON COLUMN "delegation_info_type"."other_trustee_ellipsis" IS 'Ellipsis in delegation chain after "other_trustee"'; 1.25 COMMENT ON COLUMN "delegation_info_type"."delegation_loop" IS 'Non-NULL value, if delegation chain contains a circle; See comment on "delegation_info_loop_type" for details'; 1.26 +COMMENT ON COLUMN "delegation_info_type"."participating_member_id" IS 'First participating member in delegation chain'; 1.27 1.28 1.29 CREATE FUNCTION "delegation_info" 1.30 @@ -2698,6 +2700,12 @@ 1.31 "unit_id_p", "area_id_p", "issue_id_p", 1.32 "simulate_trustee_id_p") 1.33 LOOP 1.34 + IF 1.35 + "result"."participating_member_id" ISNULL AND 1.36 + "current_row"."participation" 1.37 + THEN 1.38 + "result"."participating_member_id" := "current_row"."member_id"; 1.39 + END IF; 1.40 IF "current_row"."member_id" = "member_id_p" THEN 1.41 "result"."own_participation" := "current_row"."participation"; 1.42 "result"."own_delegation_scope" := "current_row"."scope_out";