# HG changeset patch # User jbe # Date 1459694521 -7200 # Node ID 056ad11bbe66fbec222d282ed290682e39644ec3 # Parent 14bca0b5692505acaf9503842da0450d25b9dc60 Ignore suggestions with opinion also in returned column "new_suggestion_count" of view "updated_initiative" diff -r 14bca0b56925 -r 056ad11bbe66 core.sql --- a/core.sql Sun Apr 03 16:26:38 2016 +0200 +++ b/core.sql Sun Apr 03 16:42:01 2016 +0200 @@ -2393,7 +2393,11 @@ AND "draft"."id" > "supporter"."draft_id" ) AS "new_draft", ( SELECT count(1) FROM "suggestion" + LEFT JOIN "opinion" ON + "opinion"."member_id" = "supporter"."member_id" AND + "opinion"."suggestion_id" = "suggestion"."id" WHERE "suggestion"."initiative_id" = "initiative"."id" + AND "opinion"."member_id" ISNULL AND COALESCE( "suggestion"."id" > "sent"."last_suggestion_id", TRUE