1. benny daon
  2. liquid_feedback_core

Source

liquid_feedback_core / hasadna.sql

-- NOTE: This file requires that sequence generators have not been used.
-- (All new rows need to start with id '1'.)

BEGIN;

INSERT INTO "unit" ("name") VALUES ('הסדנא');
INSERT INTO "member" ("activated", "last_activity", "active", "login", "name") VALUES
  ('now', 'now', TRUE, 'daonb',  'בני דאון'),   -- id  1
  ('now', 'now', TRUE, 'udi',  'אודי שפירו');   -- id  2

UPDATE "member" SET "password" = '$1$PcI6b1Bg$2SHjAZH2nMLFp0fxHis.Q0';

INSERT INTO "policy" (
    "index",
    "name",
    "admission_time",
    "discussion_time",
    "verification_time",
    "voting_time",
    "issue_quorum_num", "issue_quorum_den",
    "initiative_quorum_num", "initiative_quorum_den",
    "direct_majority_num", "direct_majority_den", "direct_majority_strict",
    "no_reverse_beat_path", "no_multistage_majority"
  ) VALUES (
    1,
    'Default policy',
    '1 hour', '1 hour', '1 hour', '1 hour',
    25, 100,
    20, 100,
    1, 2, TRUE,
    TRUE, FALSE );

-- set password to "login"
-- UPDATE "member" SET "password" = '$1$PcI6b1Bg$2SHjAZH2nMLFp0fxHis.Q0';

CREATE FUNCTION "time_warp"() RETURNS VOID
  LANGUAGE 'plpgsql' VOLATILE AS $$
    BEGIN
      UPDATE "issue" SET
        "snapshot"     = "snapshot"     - '1 hour 1 minute'::INTERVAL,
        "created"      = "created"      - '1 hour 1 minute'::INTERVAL,
        "accepted"     = "accepted"     - '1 hour 1 minute'::INTERVAL,
        "half_frozen"  = "half_frozen"  - '1 hour 1 minute'::INTERVAL,
        "fully_frozen" = "fully_frozen" - '1 hour 1 minute'::INTERVAL;
      PERFORM "check_everything"();
      RETURN;
    END;
  $$;


INSERT INTO "privilege" ("unit_id", "member_id", "voting_right")
  SELECT 1 AS "unit_id", "id" AS "member_id", TRUE AS "voting_right"
  FROM "member";

INSERT INTO "area" ("unit_id", "name") VALUES
  (1, 'ועדת כיתה'),  -- id 1
  (1, 'מפלגה פתוחה'),  -- id 2
  (1, 'תקציב פתוח'),  -- id 3
  (1, 'אסיפת חברים');  -- id 4

INSERT INTO "allowed_policy" ("area_id", "policy_id", "default_policy")
  VALUES (1, 1, TRUE), (2, 1, TRUE), (3, 1, TRUE), (4, 1, TRUE);

INSERT INTO "membership" ("area_id", "member_id") VALUES
  (1,  1),
  (2,  1),
  (2,  2),
  (3,  2),
  (4,  2),
  (4,  1);

COMMIT;