liquid_feedback_core
changeset 248:05eb08f56f09
Bugfix in view "unit_member_count"
author | jbe |
---|---|
date | Sat May 12 18:33:56 2012 +0200 (2012-05-12) |
parents | 4b8cc6fc2d00 |
children | d4c754c4aeaa |
files | core.sql update/core-update.v2.0.8-v2.0.9.sql |
line diff
1.1 --- a/core.sql Fri May 11 17:08:55 2012 +0200 1.2 +++ b/core.sql Sat May 12 18:33:56 2012 +0200 1.3 @@ -1888,7 +1888,7 @@ 1.4 CREATE VIEW "unit_member_count" AS 1.5 SELECT 1.6 "unit"."id" AS "unit_id", 1.7 - sum("member"."id") AS "member_count" 1.8 + count("member"."id") AS "member_count" 1.9 FROM "unit" 1.10 LEFT JOIN "privilege" 1.11 ON "privilege"."unit_id" = "unit"."id"
2.1 --- a/update/core-update.v2.0.8-v2.0.9.sql Fri May 11 17:08:55 2012 +0200 2.2 +++ b/update/core-update.v2.0.8-v2.0.9.sql Sat May 12 18:33:56 2012 +0200 2.3 @@ -4,6 +4,19 @@ 2.4 SELECT * FROM (VALUES ('2.0.9', 2, 0, 9)) 2.5 AS "subquery"("string", "major", "minor", "revision"); 2.6 2.7 +CREATE OR REPLACE VIEW "unit_member_count" AS 2.8 + SELECT 2.9 + "unit"."id" AS "unit_id", 2.10 + count("member"."id") AS "member_count" 2.11 + FROM "unit" 2.12 + LEFT JOIN "privilege" 2.13 + ON "privilege"."unit_id" = "unit"."id" 2.14 + AND "privilege"."voting_right" 2.15 + LEFT JOIN "member" 2.16 + ON "member"."id" = "privilege"."member_id" 2.17 + AND "member"."active" 2.18 + GROUP BY "unit"."id"; 2.19 + 2.20 COMMENT ON TYPE "delegation_chain_row" IS 'Type of rows returned by "delegation_chain" function'; 2.21 2.22 CREATE FUNCTION "delegation_chain_for_closed_issue"