liquid_feedback_core

diff demo.sql @ 3:3da35844c874

Version beta4

Introduced half-freeze feature: Policies can cause issues to become half-frozen for a given amount of time before becoming fully frozen for voting. When an issue is half-frozen initiatives may not modify their drafts, but creating a new initiative or removing/adding support and opinions is still possible.

Bugfix: end_of_admission snapshots are now created for accepted issues.
author jbe
date Sun Nov 15 12:00:00 2009 +0100 (2009-11-15)
parents 8d021cb5eaf4
children 4af4df1415f9
line diff
     1.1 --- a/demo.sql	Sat Nov 07 12:00:00 2009 +0100
     1.2 +++ b/demo.sql	Sun Nov 15 12:00:00 2009 +0100
     1.3 @@ -32,15 +32,32 @@
     1.4  
     1.5  INSERT INTO "policy" (
     1.6          "name",
     1.7 -        "admission_time", "discussion_time", "voting_time",
     1.8 +        "admission_time",
     1.9 +        "discussion_time",
    1.10 +        "verification_time",
    1.11 +        "voting_time",
    1.12          "issue_quorum_num", "issue_quorum_den",
    1.13          "initiative_quorum_num", "initiative_quorum_den"
    1.14      ) VALUES (
    1.15          'Default policy',
    1.16 -        '1 hour', '1 hour', '1 hour',
    1.17 +        '1 hour', '1 hour', '1 hour', '1 hour',
    1.18          25, 100,
    1.19          20, 100 );
    1.20  
    1.21 +CREATE FUNCTION "time_warp"() RETURNS VOID
    1.22 +  LANGUAGE 'plpgsql' VOLATILE AS $$
    1.23 +    BEGIN
    1.24 +      UPDATE "issue" SET
    1.25 +        "snapshot"     = "snapshot"     - '1 hour 1 minute'::INTERVAL,
    1.26 +        "created"      = "created"      - '1 hour 1 minute'::INTERVAL,
    1.27 +        "accepted"     = "accepted"     - '1 hour 1 minute'::INTERVAL,
    1.28 +        "half_frozen"  = "half_frozen"  - '1 hour 1 minute'::INTERVAL,
    1.29 +        "fully_frozen" = "fully_frozen" - '1 hour 1 minute'::INTERVAL;
    1.30 +      PERFORM "check_everything"();
    1.31 +      RETURN;
    1.32 +    END;
    1.33 +  $$;
    1.34 +
    1.35  INSERT INTO "area" ("name") VALUES
    1.36    ('Area #1'),  -- id 1
    1.37    ('Area #2'),  -- id 2
    1.38 @@ -157,10 +174,9 @@
    1.39  INSERT INTO "opinion" ("member_id", "suggestion_id", "degree", "fulfilled") VALUES
    1.40    (19, 1, 2, FALSE);
    1.41  
    1.42 -UPDATE "issue" SET "created" = "created" - '3 hour 3 minute'::INTERVAL;
    1.43 -SELECT check_everything();
    1.44 -UPDATE "issue" SET "accepted" = "accepted" - '2 hour 2 minute'::INTERVAL;
    1.45 -SELECT check_everything();
    1.46 +SELECT "time_warp"();
    1.47 +SELECT "time_warp"();
    1.48 +SELECT "time_warp"();
    1.49  
    1.50  INSERT INTO "direct_voter" ("member_id", "issue_id") VALUES
    1.51    ( 8, 1),
    1.52 @@ -219,10 +235,9 @@
    1.53    (20, 1, 5,  1),
    1.54    (21, 1, 5, -1);
    1.55  
    1.56 -UPDATE "issue" SET
    1.57 -  "snapshot" = "snapshot" - '1 hour 1 minute'::INTERVAL,
    1.58 -  "frozen" = "frozen" - '1 hour 1 minute'::INTERVAL;
    1.59 -SELECT check_everything();
    1.60 +SELECT "time_warp"();
    1.61 +
    1.62 +DROP FUNCTION "time_warp"();
    1.63  
    1.64  END;
    1.65  

Impressum / About Us