| 1 | INSERT INTO users (username, is_activate, password, description, registered_at, sex, name, email)
|
|---|
| 2 | VALUES
|
|---|
| 3 | ('user1', true, '$2a$12$0f.x7aBM2wFBZBXoLPj0BObVsk.J1kXFYo5nb4niAWkI4hk5tHvDy', 'First user', NOW(), 'M','viki', 'viki@gmail.com'),
|
|---|
| 4 | ('user2', true, '$2a$12$VkR0a47LDVM6aUqFcEJGSu9jhZCz.05tCoyiRicFObt4f2x2gijKa', 'Second user', NOW(), 'F','stefan', 'stefan@gmail.com'),
|
|---|
| 5 | ('user3', true, '$2a$12$eSLdHHJ1KFgv.dOupmloXeItjrt2o1IB6ER6Nq7WYj9Jfr2bEwK2a', 'Third user', NOW(), 'M','darko', 'darko@gmail.com'),
|
|---|
| 6 | ('user4', true, '$2a$12$dF5SXcNhMulgU3Qre3nh1e.aatRiJZsnfoBSqReGnXe9rIbHYVWhe', 'Fourth user', NOW(), 'F','andrej', 'andrej@gmail.com'),
|
|---|
| 7 | ('user5', true, '$2a$12$zHrloz8WG2zo5S6MTf1C0ez1raMlmDJdB8OOa2I1S2pVy9oI76YTa', 'Fifth user', NOW(), 'M','ramche', 'ramche@gmail.com');
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | INSERT INTO thread (content, is_created_by)
|
|---|
| 11 | VALUES
|
|---|
| 12 | ('Main content for topic thread 1', 1), --1
|
|---|
| 13 | ('Main content for topic thread 2', 2), --2
|
|---|
| 14 | ('Discussion content for topic 1', 1), --3
|
|---|
| 15 | ('Discussion content for topic 2', 2), --4
|
|---|
| 16 | ('Project-specific thread content', 3), --5
|
|---|
| 17 | ('Reply to topic 1', 4), -- 6
|
|---|
| 18 | ('Further discussion on topic 2', 5), --7
|
|---|
| 19 | ('Main content for topic thread', 1), --8
|
|---|
| 20 | ('Project-specific thread content 2', 5); --9
|
|---|
| 21 |
|
|---|
| 22 | insert into embeddable_thread(id)
|
|---|
| 23 | values (1),(2),(3),(4),(6),(7),(8);
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | INSERT INTO project_thread (id, title, repo_url)
|
|---|
| 27 | VALUES
|
|---|
| 28 | (5, 'Project 1 Thread', 'http://github.com/project1'),
|
|---|
| 29 | (9, 'Project 2 Thread', 'http://github.com/project1');
|
|---|
| 30 |
|
|---|
| 31 | INSERT INTO topic_thread (id, title, referenced_by)
|
|---|
| 32 | VALUES
|
|---|
| 33 | (1, 'Topic 1' , 5),
|
|---|
| 34 | (2, 'Topic 2', NULL),
|
|---|
| 35 | (8, 'Topic 7' , NULL);
|
|---|
| 36 |
|
|---|
| 37 | insert into topic_guidelines(topic_id,description)
|
|---|
| 38 | values
|
|---|
| 39 | (1,'Follow guidelines'),
|
|---|
| 40 | (2,'Be respectful');
|
|---|
| 41 |
|
|---|
| 42 | INSERT INTO discussion_thread (id, contained_in)
|
|---|
| 43 | VALUES
|
|---|
| 44 | (3, 1),
|
|---|
| 45 | (4, 2),
|
|---|
| 46 | (6, 1),
|
|---|
| 47 | (7, 4);
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | INSERT INTO likes (user_id, thread_id)
|
|---|
| 51 | VALUES
|
|---|
| 52 | (1, 3),
|
|---|
| 53 | (2, 4),
|
|---|
| 54 | (3, 5),
|
|---|
| 55 | (4, 6),
|
|---|
| 56 | (5, 7);
|
|---|
| 57 |
|
|---|
| 58 | -- blacklisted_user matches DDL, so skipped for now
|
|---|
| 59 |
|
|---|
| 60 | INSERT INTO permissions (name)
|
|---|
| 61 | VALUES
|
|---|
| 62 | ('READ'),
|
|---|
| 63 | ('WRITE'),
|
|---|
| 64 | ('CREATE'),
|
|---|
| 65 | ('DELETE');
|
|---|
| 66 |
|
|---|
| 67 | INSERT INTO project_role (name, valid_in, override_type)
|
|---|
| 68 | VALUES
|
|---|
| 69 | ('Admin', 5,'EXCLUDE'),
|
|---|
| 70 | ('Developer', 5,'INCLUDE');
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 | INSERT INTO project_role_is_assigned_to_developer (user_id, role_id)
|
|---|
| 74 | VALUES
|
|---|
| 75 | (3, 1),
|
|---|
| 76 | (5, 2);
|
|---|
| 77 |
|
|---|
| 78 | INSERT INTO role_permissions (for_permission, for_role)
|
|---|
| 79 | VALUES
|
|---|
| 80 | ('READ', 1),
|
|---|
| 81 | ('WRITE', 1),
|
|---|
| 82 | ('CREATE', 1),
|
|---|
| 83 | ('DELETE', 1);
|
|---|
| 84 |
|
|---|
| 85 | insert into submission(submitted_by, status, description)
|
|---|
| 86 | values
|
|---|
| 87 | (1,'PENDING','Inappropriate content'),
|
|---|
| 88 | (3,'DENIED','Spam content');
|
|---|
| 89 |
|
|---|
| 90 | INSERT INTO report (id, for_misconduct_in, about)
|
|---|
| 91 | VALUES
|
|---|
| 92 | (1, 2, 1),
|
|---|
| 93 | (2, 1, 3);
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | INSERT INTO channel (name, description, project_has, constructed_by)
|
|---|
| 97 | VALUES
|
|---|
| 98 | ('Updates', 'Project updates channel', 5, 3);
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 | ---------------- NOV TEST DATA
|
|---|
| 102 |
|
|---|
| 103 | -- Add new users (already correct)
|
|---|
| 104 | INSERT INTO users (username, is_activate, password, description, registered_at, sex, name, email)
|
|---|
| 105 | VALUES
|
|---|
| 106 | ('user6', true, '$2a$12$jB9g/.KP95fsYYOTy0pwZ.kFrwA/G2cMvPvFLzGtCk8jJ2qO3O.3u', 'Sixth user', NOW(), 'M', 'marko', 'marko@gmail.com'),
|
|---|
| 107 | ('user7', true, '$2a$12$KRxRufuMscrlQOLKGw4fBehNLWaP7Zu.M964G2JedKVM4o4wTiJaG', 'Seventh user', NOW(), 'F', 'jana', 'jana@gmail.com'),
|
|---|
| 108 | ('user8', true, '$2a$12$SCqlK.Rl72tFT0kIUNP6KuSy6BYzfdb9sKJPSWbIK8/uk7y8U7hgS', 'Eighth user', NOW(), 'M', 'nikola', 'nikola@gmail.com'),
|
|---|
| 109 | ('user9', true, '$2a$12$LpDTYNb/i0cohkmszkx93ef9rkgFTNFQz/KqHEYIAE9MPOmlyXJ9m', 'Ninth user', NOW(), 'F', 'elena', 'elena@gmail.com'),
|
|---|
| 110 | ('user10', true, '$2a$12$p/kZdDKCUCmXjWTsknss/.UaD4a8vxrTcfvc6mdkpHRRPqRZLLtr6', 'Tenth user', NOW(), 'M', 'petar', 'petar@gmail.com');
|
|---|
| 111 |
|
|---|
| 112 | -- Add new developers (matches DDL)
|
|---|
| 113 | INSERT INTO developer (id)
|
|---|
| 114 | VALUES (6),(7),(8),(9),(10);
|
|---|
| 115 |
|
|---|
| 116 | -- Add new threads
|
|---|
| 117 | INSERT INTO thread (content, is_created_by)
|
|---|
| 118 | VALUES
|
|---|
| 119 | ('Main content for topic thread 3', 6), --10
|
|---|
| 120 | ('Main content for topic thread 4', 7), --11
|
|---|
| 121 | ('Discussion content for topic 3', 6), --12
|
|---|
| 122 | ('Discussion content for topic 4', 7), --13
|
|---|
| 123 | ('Project-specific thread content 3', 8), --14
|
|---|
| 124 | ('Reply to topic 3', 9), --15
|
|---|
| 125 | ('Further discussion on topic 4', 10), --16
|
|---|
| 126 | ('Main content for topic thread 5', 6), --17
|
|---|
| 127 | ('Project-specific thread content 4', 10); --18
|
|---|
| 128 |
|
|---|
| 129 | -- Add embeddable_thread entries
|
|---|
| 130 | INSERT INTO embeddable_thread (id)
|
|---|
| 131 | VALUES (10),(11),(12),(13),(15),(16),(17);
|
|---|
| 132 |
|
|---|
| 133 | -- New project_threads (matches DDL)
|
|---|
| 134 | INSERT INTO project_thread (id, title, repo_url)
|
|---|
| 135 | VALUES
|
|---|
| 136 | (14, 'Project 3 Thread', 'http://github.com/project3'),
|
|---|
| 137 | (18, 'Project 4 Thread', 'http://github.com/project4');
|
|---|
| 138 |
|
|---|
| 139 | -- New topic_threads
|
|---|
| 140 | INSERT INTO topic_thread (id, title, referenced_by)
|
|---|
| 141 | VALUES
|
|---|
| 142 | (10, 'Topic 3', 14),
|
|---|
| 143 | (11, 'Topic 4', NULL),
|
|---|
| 144 | (17, 'Topic 8', NULL);
|
|---|
| 145 |
|
|---|
| 146 | -- Guidelines
|
|---|
| 147 | INSERT INTO topic_guidelines (topic_id, description)
|
|---|
| 148 | VALUES
|
|---|
| 149 | (10, 'Stay on topic'),
|
|---|
| 150 | (11, 'No personal attacks');
|
|---|
| 151 |
|
|---|
| 152 | -- New discussion_threads
|
|---|
| 153 | INSERT INTO discussion_thread (id, contained_in)
|
|---|
| 154 | VALUES
|
|---|
| 155 | (12, 10),
|
|---|
| 156 | (13, 11),
|
|---|
| 157 | (15, 10),
|
|---|
| 158 | (16, 13);
|
|---|
| 159 |
|
|---|
| 160 | -- Likes (matches DDL)
|
|---|
| 161 | INSERT INTO likes (user_id, thread_id)
|
|---|
| 162 | VALUES
|
|---|
| 163 | (6, 12),
|
|---|
| 164 | (7, 13),
|
|---|
| 165 | (8, 14),
|
|---|
| 166 | (9, 15),
|
|---|
| 167 | (10, 16);
|
|---|
| 168 |
|
|---|
| 169 | -- blacklisted_user (already matches DDL)
|
|---|
| 170 |
|
|---|
| 171 | -- New submissions
|
|---|
| 172 | INSERT INTO submission (submitted_by, status, description)
|
|---|
| 173 | VALUES
|
|---|
| 174 | (6, 'PENDING', 'Request for new feature'),
|
|---|
| 175 | (7, 'ACCEPTED', 'Bug report');
|
|---|
| 176 |
|
|---|
| 177 | -- Reports
|
|---|
| 178 | INSERT INTO report (id, for_misconduct_in, about)
|
|---|
| 179 | VALUES
|
|---|
| 180 | (3, 10, 7),
|
|---|
| 181 | (4, 11, 8);
|
|---|
| 182 |
|
|---|
| 183 | -- Associate developers with projects
|
|---|
| 184 | INSERT INTO developer_associated_with_project (in_project, about_dev, started_at)
|
|---|
| 185 | VALUES
|
|---|
| 186 | (14, 6, NOW()),
|
|---|
| 187 | (14, 7, NOW()),
|
|---|
| 188 | (18, 8, NOW()),
|
|---|
| 189 | (18, 9, NOW());
|
|---|
| 190 |
|
|---|
| 191 | -- Channels
|
|---|
| 192 | INSERT INTO channel (name, description, project_has, constructed_by)
|
|---|
| 193 | VALUES
|
|---|
| 194 | ('General2', 'General discussion', 14, 6),
|
|---|
| 195 | ('Bugs', 'Bug reports and fixes', 14, 7),
|
|---|
| 196 | ('General2', 'General discussion', 18, 8),
|
|---|
| 197 | ('Ideas', 'Feature ideas', 18, 9); |
|---|