X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fsql%2Fsample_data_test_v4.sql;fp=tests%2Fsql%2Fsample_data_test_v4.sql;h=161e8853b813a04117a97d1561086584d9455a2e;hb=4cfc1bb07644043d1e223178a98ea47f6a61d338;hp=0000000000000000000000000000000000000000;hpb=b0d66ce5eaacd3eb91b248c7ea7f6b97a90fa65b;p=motion.git diff --git a/tests/sql/sample_data_test_v4.sql b/tests/sql/sample_data_test_v4.sql new file mode 100644 index 0000000..161e885 --- /dev/null +++ b/tests/sql/sample_data_test_v4.sql @@ -0,0 +1,27 @@ +-- sample data for scheme version 4 +INSERT INTO voter (id,email) VALUES (1, 'User A'); +INSERT INTO voter (id,email) VALUES (2, 'User B'); +INSERT INTO voter (id,email) VALUES (3, 'User C'); +INSERT INTO voter (id,email) VALUES (4, 'User D'); +INSERT INTO voter (id,email) VALUES (5, 'User E'); +ALTER SEQUENCE voter_id_seq RESTART WITH 6; + +INSERT INTO motion (id,identifier,name,type,host,content,posed,posed_by,deadline,canceled,cancelation_reason,canceled_by) VALUES + (1,'g1.20200402.001','Motion A','group1','127.0.0.1:5000','My special motion','2020-04-02 21:40:33.780364',1,'2020-04-02 21:40:33.780364',Null,Null,Null); +INSERT INTO motion (id,identifier,name,type,host,content,posed,posed_by,deadline,canceled,cancelation_reason,canceled_by) VALUES + (2,'g1.20200402.002','Motion B','group1','127.0.0.1:5001','A second motion','2020-04-02 21:41:26.588442',1,'2020-04-04 21:41:26.588442',Null,Null,Null); +INSERT INTO motion (id,identifier,name,type,host,content,posed,posed_by,deadline,canceled,cancelation_reason,canceled_by) VALUES + (3,'g1.20200402.003','Motion C','group1','127.0.0.1:5000','A third motion', '2020-04-02 21:47:24.969588',1,'2020-04-04 21:47:24.969588','2020-04-03 21:48:24.969588','Entered with wrong text',1); +-- add motion with timespan from now to 1 day from now +INSERT INTO motion (id,identifier,name,type,host,content,posed,posed_by,deadline,canceled,cancelation_reason,canceled_by) VALUES + (4,'g1.20200402.004','Motion D','group1','127.0.0.1:5000','A fourth motion', current_timestamp ,1,current_timestamp + interval '1' day,Null,Null,Null); +ALTER SEQUENCE motion_id_seq RESTART WITH 5; + +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (1,1,1,'yes','2020-04-02 21:54:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (1,2,2,'yes','2020-04-02 21:54:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (1,3,2,'no','2020-04-02 21:54:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (2,1,1,'yes','2020-04-02 21:54:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (2,2,2,'no','2020-04-02 21:54:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (2,3,3,'no','2020-04-02 21:54:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (3,3,3,'yes','2020-04-02 21:48:34.469784'); +INSERT INTO vote (motion_id,voter_id,proxy_id,result,entered) VALUES (4,1,5,'yes','2020-04-02 21:48:34.469784');