liquid_feedback_core

changeset 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
files core.sql update/core-update.v2.2.5-v2.2.6.sql
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",
     2.1 --- a/update/core-update.v2.2.5-v2.2.6.sql	Fri Oct 11 13:17:29 2013 +0200
     2.2 +++ b/update/core-update.v2.2.5-v2.2.6.sql	Fri Oct 11 13:42:16 2013 +0200
     2.3 @@ -26,4 +26,21 @@
     2.4  
     2.5  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';
     2.6  
     2.7 +CREATE VIEW "open_issues_ordered_with_minimum_position" AS
     2.8 +  SELECT
     2.9 +    "area_id",
    2.10 +    "id" AS "issue_id",
    2.11 +    "order_in_admission_state" * 2 - 1 AS "minimum_position"
    2.12 +  FROM "issue"
    2.13 +  WHERE "closed" ISNULL
    2.14 +  ORDER BY
    2.15 +    coalesce(
    2.16 +      "fully_frozen" + "voting_time",
    2.17 +      "half_frozen" + "verification_time",
    2.18 +      "accepted" + "discussion_time",
    2.19 +      "created" + "admission_time"
    2.20 +    ) - now();
    2.21 +
    2.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';
    2.23 +
    2.24  COMMIT;

Impressum / About Us