liquid_feedback_core

annotate demo.sql @ 95:625f88e41125

Added tag v1.3.0 for changeset fb9688f31740
author jbe
date Mon Nov 08 01:46:58 2010 +0100 (2010-11-08)
parents 7744034552a3
children 58451b5565ae
rev   line source
jbe@0 1 -- NOTE: This file requires that sequence generators have not been used.
jbe@0 2 -- (All new rows need to start with id '1'.)
jbe@0 3
jbe@0 4 BEGIN;
jbe@0 5
jbe@0 6 INSERT INTO "member" ("login", "name") VALUES
jbe@0 7 ('user1', 'User #1'), -- id 1
jbe@0 8 ('user2', 'User #2'), -- id 2
jbe@0 9 ('user3', 'User #3'), -- id 3
jbe@0 10 ('user4', 'User #4'), -- id 4
jbe@0 11 ('user5', 'User #5'), -- id 5
jbe@0 12 ('user6', 'User #6'), -- id 6
jbe@0 13 ('user7', 'User #7'), -- id 7
jbe@0 14 ('user8', 'User #8'), -- id 8
jbe@0 15 ('user9', 'User #9'), -- id 9
jbe@0 16 ('user10', 'User #10'), -- id 10
jbe@0 17 ('user11', 'User #11'), -- id 11
jbe@0 18 ('user12', 'User #12'), -- id 12
jbe@0 19 ('user13', 'User #13'), -- id 13
jbe@0 20 ('user14', 'User #14'), -- id 14
jbe@0 21 ('user15', 'User #15'), -- id 15
jbe@0 22 ('user16', 'User #16'), -- id 16
jbe@0 23 ('user17', 'User #17'), -- id 17
jbe@0 24 ('user18', 'User #18'), -- id 18
jbe@0 25 ('user19', 'User #19'), -- id 19
jbe@0 26 ('user20', 'User #20'), -- id 20
jbe@0 27 ('user21', 'User #21'), -- id 21
jbe@0 28 ('user22', 'User #22'), -- id 22
jbe@0 29 ('user23', 'User #23'); -- id 23
jbe@0 30
poelzi@77 31 -- set password to "login"
poelzi@77 32 UPDATE "member" SET "password" = '$1$PcI6b1Bg$2SHjAZH2nMLFp0fxHis.Q0';
jbe@0 33
jbe@0 34 INSERT INTO "policy" (
jbe@9 35 "index",
jbe@0 36 "name",
jbe@3 37 "admission_time",
jbe@3 38 "discussion_time",
jbe@3 39 "verification_time",
jbe@3 40 "voting_time",
jbe@0 41 "issue_quorum_num", "issue_quorum_den",
jbe@0 42 "initiative_quorum_num", "initiative_quorum_den"
jbe@0 43 ) VALUES (
jbe@9 44 1,
jbe@0 45 'Default policy',
jbe@3 46 '1 hour', '1 hour', '1 hour', '1 hour',
jbe@0 47 25, 100,
jbe@0 48 20, 100 );
jbe@0 49
jbe@3 50 CREATE FUNCTION "time_warp"() RETURNS VOID
jbe@3 51 LANGUAGE 'plpgsql' VOLATILE AS $$
jbe@3 52 BEGIN
jbe@3 53 UPDATE "issue" SET
jbe@3 54 "snapshot" = "snapshot" - '1 hour 1 minute'::INTERVAL,
jbe@3 55 "created" = "created" - '1 hour 1 minute'::INTERVAL,
jbe@3 56 "accepted" = "accepted" - '1 hour 1 minute'::INTERVAL,
jbe@3 57 "half_frozen" = "half_frozen" - '1 hour 1 minute'::INTERVAL,
jbe@3 58 "fully_frozen" = "fully_frozen" - '1 hour 1 minute'::INTERVAL;
jbe@3 59 PERFORM "check_everything"();
jbe@3 60 RETURN;
jbe@3 61 END;
jbe@3 62 $$;
jbe@3 63
jbe@0 64 INSERT INTO "area" ("name") VALUES
jbe@0 65 ('Area #1'), -- id 1
jbe@0 66 ('Area #2'), -- id 2
jbe@0 67 ('Area #3'), -- id 3
jbe@0 68 ('Area #4'); -- id 4
jbe@0 69
jbe@9 70 INSERT INTO "allowed_policy" ("area_id", "policy_id", "default_policy")
jbe@9 71 VALUES (1, 1, TRUE), (2, 1, TRUE), (3, 1, TRUE), (4, 1, TRUE);
jbe@9 72
jbe@0 73 INSERT INTO "membership" ("area_id", "member_id", "autoreject") VALUES
jbe@0 74 (1, 9, FALSE),
jbe@0 75 (1, 19, FALSE),
jbe@0 76 (2, 9, TRUE),
jbe@0 77 (2, 10, TRUE),
jbe@0 78 (2, 17, TRUE),
jbe@0 79 (3, 9, FALSE),
jbe@0 80 (3, 11, FALSE),
jbe@0 81 (3, 12, TRUE),
jbe@0 82 (3, 14, FALSE),
jbe@0 83 (3, 20, FALSE),
jbe@0 84 (3, 21, TRUE),
jbe@0 85 (3, 22, TRUE),
jbe@0 86 (4, 6, FALSE),
jbe@0 87 (4, 9, FALSE),
jbe@0 88 (4, 13, FALSE),
jbe@0 89 (4, 22, TRUE);
jbe@0 90
jbe@0 91 -- global delegations
jbe@0 92 INSERT INTO "delegation"
jbe@10 93 ("truster_id", "scope", "trustee_id") VALUES
jbe@10 94 ( 1, 'global', 9),
jbe@10 95 ( 2, 'global', 11),
jbe@10 96 ( 3, 'global', 12),
jbe@10 97 ( 4, 'global', 13),
jbe@10 98 ( 5, 'global', 14),
jbe@10 99 ( 6, 'global', 7),
jbe@10 100 ( 7, 'global', 8),
jbe@10 101 ( 8, 'global', 6),
jbe@10 102 (10, 'global', 9),
jbe@10 103 (11, 'global', 9),
jbe@10 104 (12, 'global', 21),
jbe@10 105 (15, 'global', 10),
jbe@10 106 (16, 'global', 17),
jbe@10 107 (17, 'global', 19),
jbe@10 108 (18, 'global', 19),
jbe@10 109 (23, 'global', 22);
jbe@0 110
jbe@0 111 -- delegations for topics
jbe@0 112 INSERT INTO "delegation"
jbe@10 113 ("area_id", "truster_id", "scope", "trustee_id") VALUES
jbe@10 114 (1, 3, 'area', 17),
jbe@10 115 (2, 5, 'area', 10),
jbe@10 116 (2, 9, 'area', 10),
jbe@10 117 (3, 4, 'area', 14),
jbe@10 118 (3, 16, 'area', 20),
jbe@10 119 (3, 19, 'area', 20),
jbe@10 120 (4, 5, 'area', 13),
jbe@10 121 (4, 12, 'area', 22);
jbe@0 122
jbe@0 123 INSERT INTO "issue" ("area_id", "policy_id") VALUES
jbe@0 124 (3, 1); -- id 1
jbe@0 125
jbe@0 126 INSERT INTO "initiative" ("issue_id", "name") VALUES
jbe@0 127 (1, 'Initiative #1'), -- id 1
jbe@0 128 (1, 'Initiative #2'), -- id 2
jbe@0 129 (1, 'Initiative #3'), -- id 3
jbe@0 130 (1, 'Initiative #4'), -- id 4
jbe@0 131 (1, 'Initiative #5'), -- id 5
jbe@0 132 (1, 'Initiative #6'), -- id 6
jbe@0 133 (1, 'Initiative #7'); -- id 7
jbe@0 134
jbe@0 135 INSERT INTO "draft" ("initiative_id", "author_id", "content") VALUES
jbe@0 136 (1, 17, 'Lorem ipsum...'), -- id 1
jbe@0 137 (2, 20, 'Lorem ipsum...'), -- id 2
jbe@0 138 (3, 20, 'Lorem ipsum...'), -- id 3
jbe@0 139 (4, 20, 'Lorem ipsum...'), -- id 4
jbe@0 140 (5, 14, 'Lorem ipsum...'), -- id 5
jbe@0 141 (6, 11, 'Lorem ipsum...'), -- id 6
jbe@0 142 (7, 12, 'Lorem ipsum...'); -- id 7
jbe@0 143
jbe@0 144 INSERT INTO "initiator" ("initiative_id", "member_id") VALUES
jbe@0 145 (1, 17),
jbe@0 146 (1, 19),
jbe@0 147 (2, 20),
jbe@0 148 (3, 20),
jbe@0 149 (4, 20),
jbe@0 150 (5, 14),
jbe@0 151 (6, 11),
jbe@0 152 (7, 12);
jbe@0 153
jbe@0 154 INSERT INTO "supporter" ("member_id", "initiative_id", "draft_id") VALUES
jbe@0 155 ( 7, 4, 4),
jbe@0 156 ( 8, 2, 2),
jbe@0 157 (11, 6, 6),
jbe@0 158 (12, 7, 7),
jbe@0 159 (14, 1, 1),
jbe@0 160 (14, 2, 2),
jbe@0 161 (14, 3, 3),
jbe@0 162 (14, 4, 4),
jbe@0 163 (14, 5, 5),
jbe@0 164 (14, 6, 6),
jbe@0 165 (14, 7, 7),
jbe@0 166 (17, 1, 1),
jbe@0 167 (17, 3, 3),
jbe@0 168 (19, 1, 1),
jbe@0 169 (19, 2, 2),
jbe@0 170 (20, 1, 1),
jbe@0 171 (20, 2, 2),
jbe@0 172 (20, 3, 3),
jbe@0 173 (20, 4, 4),
jbe@0 174 (20, 5, 5);
jbe@0 175
jbe@0 176 INSERT INTO "suggestion" ("initiative_id", "author_id", "name", "description") VALUES
jbe@0 177 (1, 19, 'Suggestion #1', 'Lorem ipsum...'); -- id 1
jbe@0 178 INSERT INTO "opinion" ("member_id", "suggestion_id", "degree", "fulfilled") VALUES
jbe@0 179 (14, 1, 2, FALSE);
jbe@0 180 INSERT INTO "opinion" ("member_id", "suggestion_id", "degree", "fulfilled") VALUES
jbe@0 181 (19, 1, 2, FALSE);
jbe@0 182
jbe@3 183 SELECT "time_warp"();
jbe@3 184 SELECT "time_warp"();
jbe@3 185 SELECT "time_warp"();
jbe@0 186
jbe@0 187 INSERT INTO "direct_voter" ("member_id", "issue_id") VALUES
jbe@0 188 ( 8, 1),
jbe@0 189 ( 9, 1),
jbe@0 190 (11, 1),
jbe@0 191 (12, 1),
jbe@0 192 (14, 1),
jbe@0 193 (19, 1),
jbe@0 194 (20, 1),
jbe@0 195 (21, 1);
jbe@0 196
jbe@0 197 INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES
jbe@0 198 ( 8, 1, 1, 1),
jbe@0 199 ( 8, 1, 2, 1),
jbe@0 200 ( 8, 1, 3, 1),
jbe@0 201 ( 8, 1, 4, 1),
jbe@0 202 ( 8, 1, 5, 1),
jbe@0 203 ( 8, 1, 6, -1),
jbe@0 204 ( 8, 1, 7, -1),
jbe@0 205 ( 9, 1, 1, -2),
jbe@0 206 ( 9, 1, 2, -3),
jbe@0 207 ( 9, 1, 3, -2),
jbe@0 208 ( 9, 1, 4, -2),
jbe@0 209 ( 9, 1, 5, -2),
jbe@0 210 ( 9, 1, 6, -1),
jbe@0 211 (11, 1, 1, -1),
jbe@0 212 (11, 1, 2, -1),
jbe@0 213 (11, 1, 3, -1),
jbe@0 214 (11, 1, 4, -1),
jbe@0 215 (11, 1, 5, -1),
jbe@0 216 (11, 1, 6, 2),
jbe@0 217 (11, 1, 7, 1),
jbe@0 218 (12, 1, 1, -1),
jbe@0 219 (12, 1, 3, -1),
jbe@0 220 (12, 1, 4, -1),
jbe@0 221 (12, 1, 5, -1),
jbe@0 222 (12, 1, 6, -2),
jbe@0 223 (12, 1, 7, 1),
jbe@0 224 (14, 1, 1, 1),
jbe@0 225 (14, 1, 2, 3),
jbe@0 226 (14, 1, 3, 1),
jbe@0 227 (14, 1, 4, 2),
jbe@0 228 (14, 1, 5, 1),
jbe@0 229 (14, 1, 6, 1),
jbe@0 230 (14, 1, 7, 1),
jbe@0 231 (19, 1, 1, 3),
jbe@0 232 (19, 1, 2, 4),
jbe@0 233 (19, 1, 3, 2),
jbe@0 234 (19, 1, 4, 2),
jbe@0 235 (19, 1, 5, 2),
jbe@0 236 (19, 1, 7, 1),
jbe@0 237 (20, 1, 1, 1),
jbe@0 238 (20, 1, 2, 2),
jbe@0 239 (20, 1, 3, 1),
jbe@0 240 (20, 1, 4, 1),
jbe@0 241 (20, 1, 5, 1),
jbe@0 242 (21, 1, 5, -1);
jbe@0 243
jbe@3 244 SELECT "time_warp"();
jbe@3 245
jbe@3 246 DROP FUNCTION "time_warp"();
jbe@0 247
poelzi@78 248 -- Test policies that help with testing specific frontend parts
poelzi@78 249
poelzi@78 250 INSERT INTO "policy" (
poelzi@78 251 "index",
poelzi@78 252 "active",
poelzi@78 253 "name",
poelzi@78 254 "description",
poelzi@78 255 "admission_time",
poelzi@78 256 "discussion_time",
poelzi@78 257 "verification_time",
poelzi@78 258 "voting_time",
poelzi@78 259 "issue_quorum_num",
poelzi@78 260 "issue_quorum_den",
poelzi@78 261 "initiative_quorum_num",
poelzi@78 262 "initiative_quorum_den"
poelzi@78 263 ) VALUES (
poelzi@78 264 1,
poelzi@78 265 TRUE,
poelzi@78 266 'Test New',
poelzi@78 267 DEFAULT,
poelzi@78 268 '2 days',
poelzi@78 269 '1 second',
poelzi@78 270 '1 second',
poelzi@78 271 '1 second',
poelzi@82 272 0, 100,
poelzi@82 273 0, 100
poelzi@78 274 ), (
poelzi@78 275 1,
poelzi@78 276 TRUE,
poelzi@78 277 'Test Accept',
poelzi@78 278 DEFAULT,
poelzi@78 279 '1 second',
poelzi@78 280 '2 days',
poelzi@78 281 '1 second',
poelzi@78 282 '1 second',
poelzi@82 283 0, 100,
poelzi@82 284 0, 100
poelzi@78 285 ), (
poelzi@78 286 1,
poelzi@78 287 TRUE,
poelzi@78 288 'Test Frozen',
poelzi@78 289 DEFAULT,
poelzi@78 290 '1 second',
poelzi@78 291 '5 minutes',
poelzi@78 292 '2 days',
poelzi@78 293 '1 second',
poelzi@82 294 0, 100,
poelzi@82 295 0, 100
poelzi@78 296 ), (
poelzi@78 297 1,
poelzi@78 298 TRUE,
poelzi@78 299 'Test Voting',
poelzi@78 300 DEFAULT,
poelzi@78 301 '1 second',
poelzi@78 302 '5 minutes',
poelzi@78 303 '1 second',
poelzi@78 304 '2 days',
poelzi@82 305 0, 100,
poelzi@82 306 0, 100
poelzi@78 307 );
jbe@0 308 END;
jbe@0 309

Impressum / About Us