# HG changeset patch # User jbe # Date 1329940259 -3600 # Node ID 9474e20385900bf38bcf24e83e9ecb5034d43ea9 # Parent f6ec320e19d4c599e64bc1a05de5fc626e917b16 Change in "rank" order of admitted initiatives: Winner first, then eligible, then non-eligible initiatives; second ordering is "schulze_rank"; third ordering is "vote_ratio"; fallback ordering is "id" diff -r f6ec320e19d4 -r 9474e2038590 core.sql --- a/core.sql Wed Feb 22 20:45:01 2012 +0100 +++ b/core.sql Wed Feb 22 20:50:59 2012 +0100 @@ -3787,7 +3787,10 @@ SELECT "id" AS "initiative_id" FROM "initiative" WHERE "issue_id" = "issue_id_p" AND "eligible" - ORDER BY "schulze_rank", "id" + ORDER BY + "schulze_rank", + "vote_ratio"("positive_votes", "negative_votes"), + "id" LIMIT 1 ) AS "subquery" WHERE "id" = "subquery"."initiative_id"; @@ -3799,8 +3802,9 @@ WHERE "issue_id" = "issue_id_p" AND "admitted" ORDER BY "winner" DESC, - ("direct_majority" AND "indirect_majority") DESC, + "eligible" DESC, "schulze_rank", + "vote_ratio"("positive_votes", "negative_votes"), "id" LOOP UPDATE "initiative" SET "rank" = "rank_v"