liquid_feedback_core
diff update/core-update.v2.0.8-v2.0.9.sql @ 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 |
line diff
1.1 --- a/update/core-update.v2.0.8-v2.0.9.sql Fri May 11 17:08:55 2012 +0200 1.2 +++ b/update/core-update.v2.0.8-v2.0.9.sql Sat May 12 18:33:56 2012 +0200 1.3 @@ -4,6 +4,19 @@ 1.4 SELECT * FROM (VALUES ('2.0.9', 2, 0, 9)) 1.5 AS "subquery"("string", "major", "minor", "revision"); 1.6 1.7 +CREATE OR REPLACE VIEW "unit_member_count" AS 1.8 + SELECT 1.9 + "unit"."id" AS "unit_id", 1.10 + count("member"."id") AS "member_count" 1.11 + FROM "unit" 1.12 + LEFT JOIN "privilege" 1.13 + ON "privilege"."unit_id" = "unit"."id" 1.14 + AND "privilege"."voting_right" 1.15 + LEFT JOIN "member" 1.16 + ON "member"."id" = "privilege"."member_id" 1.17 + AND "member"."active" 1.18 + GROUP BY "unit"."id"; 1.19 + 1.20 COMMENT ON TYPE "delegation_chain_row" IS 'Type of rows returned by "delegation_chain" function'; 1.21 1.22 CREATE FUNCTION "delegation_chain_for_closed_issue"