liquid_feedback_core

diff core.sql @ 397:1e4fcb7f0eac

Added helper view "open_issues_ordered_with_minimum_position" for lf_update_issue_order.c
author jbe
date Fri Oct 11 13:42:16 2013 +0200 (2013-10-11)
parents ad50723ef4ed
children 806561cce3b1
line diff
     1.1 --- a/core.sql	Fri Oct 11 13:17:29 2013 +0200
     1.2 +++ b/core.sql	Fri Oct 11 13:42:16 2013 +0200
     1.3 @@ -2082,6 +2082,24 @@
     1.4  COMMENT ON VIEW "issue_supporter_in_admission_state" IS 'Helper view for "lf_update_issue_order" to allow a (proportional) ordering of issues within an area';
     1.5  
     1.6  
     1.7 +CREATE VIEW "open_issues_ordered_with_minimum_position" AS
     1.8 +  SELECT
     1.9 +    "area_id",
    1.10 +    "id" AS "issue_id",
    1.11 +    "order_in_admission_state" * 2 - 1 AS "minimum_position"
    1.12 +  FROM "issue"
    1.13 +  WHERE "closed" ISNULL
    1.14 +  ORDER BY
    1.15 +    coalesce(
    1.16 +      "fully_frozen" + "voting_time",
    1.17 +      "half_frozen" + "verification_time",
    1.18 +      "accepted" + "discussion_time",
    1.19 +      "created" + "admission_time"
    1.20 +    ) - now();
    1.21 +
    1.22 +COMMENT ON VIEW "open_issues_ordered_with_minimum_position" IS 'Helper view for "lf_update_issue_order" to allow a (mixed) ordering of issues within an area';
    1.23 +
    1.24 +
    1.25  CREATE VIEW "initiative_suggestion_order_calculation" AS
    1.26    SELECT
    1.27      "initiative"."id" AS "initiative_id",

Impressum / About Us