
bsw/jbe@0: BEGIN;
bsw/jbe@0: 
bsw/jbe@0: INSERT INTO "member" ("login", "name", "ident_number") VALUES
bsw/jbe@0:   ('bernd',    'Bernd',    '002'),
bsw/jbe@0:   ('cesar',    'Cesar',    '003'),
bsw/jbe@0:   ('doris',    'Doris',    '004'),
bsw/jbe@0:   ('emil',     'Emil',     '005'),
bsw/jbe@0:   ('frank',    'Frank',    '006'),
bsw/jbe@0:   ('gerhard',  'Gerhard',  '007'),
bsw/jbe@0:   ('hugo',     'Hugo',     '008'),
bsw/jbe@0:   ('ines',     'Ines',     '009'),
bsw/jbe@0:   ('johann',   'Johann',   '010'),
bsw/jbe@0:   ('klaus',    'Klaus',    '011'),
bsw/jbe@0:   ('lisa',     'Lisa',     '012'),
bsw/jbe@0:   ('monika',   'Monika',   '013'),
bsw/jbe@0:   ('norbert',  'Norbert',  '014'),
bsw/jbe@0:   ('olaf',     'Olaf',     '015'),
bsw/jbe@0:   ('peter',    'Peter',    '016'),
bsw/jbe@0:   ('quinn',    'Quinn',    '017'),
bsw/jbe@0:   ('ralf',     'Ralf',     '018'),
bsw/jbe@0:   ('sabine',   'Sabine',   '019'),
bsw/jbe@0:   ('tobias',   'Tobias',   '020'),
bsw/jbe@0:   ('ulla',     'Ulla',     '021'),
bsw/jbe@0:   ('vincent',  'Vincent',  '022'),
bsw/jbe@0:   ('wolfgang', 'Wolfgang', '023'),
bsw/jbe@0:   ('xavier',   'Xavier',   '024'),
bsw/jbe@0:   ('yoko',     'Yoko',     '025'),
bsw/jbe@0:   ('zareb',    'Zareb',    '026');
bsw/jbe@0: 
bsw/jbe@0: INSERT INTO "issue" ("area_id", "policy_id") VALUES (1, 3);
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #1');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #2');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #3');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #4');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #5');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #6');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #7');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #8');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #9');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #10');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #11');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #12');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #13');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #14');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #15');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #16');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #17');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #18');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #19');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #20');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #21');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #22');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #23');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #24');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #25');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #26');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #27');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #28');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #29');
bsw/jbe@0: INSERT INTO "initiative" ("issue_id", "name") VALUES (1, 'Initiative #30');
bsw/jbe@0: 
bsw/jbe@0: INSERT INTO "draft" ("initiative_id", "content") SELECT "id", 'Lorem ipsum ...' FROM "initiative";
bsw/jbe@0: INSERT INTO "initiator" ("member_id", "initiative_id") SELECT 1, "id" FROM "initiative";
bsw/jbe@0: INSERT INTO "supporter" ("member_id", "initiative_id", "draft_id") SELECT "member"."id", "initiative"."id", "initiative"."id" FROM "member", "initiative";
bsw/jbe@0: 
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 1, 1);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 2, 2);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 3, 3);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 4, 4);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 5, 5);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 6, 6);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 7, 7);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 8, 8);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 9, 9);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 10, 10);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 11, 11);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 12, 12);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 13, 13);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 14, 14);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 15, 15);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 16, 16);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 17, 17);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 18, 18);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 19, 19);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 20, 20);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 21, 21);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 22, 22);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 23, 23);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 24, 24);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 25, 25);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 26, 26);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 27, 27);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 28, 28);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 29, 29);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (1, 1, 30, 30);
bsw/jbe@0: 
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 1, 2);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 2, 1);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 3, 3);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 4, 4);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 5, 5);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 6, 6);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 7, 7);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 8, 8);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 9, 9);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 10, 10);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 11, 11);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 12, 12);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 13, 13);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 14, 14);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 15, 15);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 16, 16);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 17, 17);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 18, 18);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 19, 19);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 20, 20);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 21, 21);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 22, 22);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 23, 23);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 24, 24);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 25, 25);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 26, 26);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 27, 27);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 28, 28);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 29, 29);
bsw/jbe@0: INSERT INTO "vote" ("member_id", "issue_id", "initiative_id", "grade") VALUES (2, 1, 30, 30);
bsw/jbe@0: 
bsw/jbe@0: 
bsw/jbe@0: SELECT check_issues();
bsw/jbe@0: UPDATE issue SET frozen = now();
bsw/jbe@0: 
bsw/jbe@0: END;
bsw/jbe@0: 
bsw/jbe@0: -- UPDATE issue SET closed = now();




