RelationalDesign: V2__add_test_data.sql

File V2__add_test_data.sql, 3.7 KB (added by 226026, 35 hours ago)
Line 
1INSERT INTO users (username, is_activate, password, description, registered_at, sex,name,email)
2VALUES
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
10INSERT INTO thread (content, user_id)
11VALUES
12 ('Main content for topic thread 1', 1),
13 ('Main content for topic thread 2', 2),
14 ('Discussion content for topic 1', 1),
15 ('Discussion content for topic 2', 2),
16 ('Project-specific thread content', 3),
17 ('Reply to topic 1', 4),
18 ('Further discussion on topic 2', 5),
19 ('Main content for topic thread', 1),
20 ('Main content for topic thread', 2),
21 ('Discussion content for topic 1', 1),
22 ('Discussion content for topic 2', 2),
23 ('Project-specific thread content', 3),
24 ('Reply to topic 1', 4),
25 ('Further discussion on topic 2', 5),
26 ('Further discussion on topic 2', 5),
27 ('Main content for topic thread', 1),
28 ('Main content for topic thread', 2),
29 ('Discussion content for topic 1', 1),
30 ('Discussion content for topic 2', 2),
31 ('Project-specific thread content', 3),
32 ('Reply to topic 1', 4),
33 ('Further discussion on topic 2', 5);
34
35INSERT INTO topic_thread (id, title, parent_id)
36VALUES
37 (1, 'Topic 1' , 5),
38 (2, 'Topic 2', 5),
39 (8, 'Topic 7' , NULL),
40 (9, 'Topic 8', NULL),
41 (16, 'Topic 9' , NULL),
42 (17, 'Topic 10', NULL);
43
44insert into topic_guidelines(topic_id,description)
45values
46 (1,'Follow guidelines'),
47 ( 2,'Be respectful');
48
49INSERT INTO discussion_thread (id, parent_id)
50VALUES
51 (3, 1),
52 (4, 2),
53 (6, 3),
54 (7, 4);
55
56INSERT INTO project_thread (id, title, repo_url)
57VALUES
58 (5, 'Project 1 Thread', 'http://github.com/project1'),
59 (10, 'Project 2 Thread', 'http://github.com/project1'),
60 (15, 'Project 3 Thread', 'http://github.com/project1');
61
62INSERT INTO likes (user_id, thread_id)
63VALUES
64 (1, 3),
65 (2, 4),
66 (3, 5),
67 (4, 6),
68 (5, 7);
69
70INSERT INTO blacklisted_user (topic_id, user_id, moderator_id, start_date, end_date, reason)
71VALUES
72 (1, 2, 1, NOW(), NOW() + INTERVAL '7 days', 'Spamming'),
73 (2, 3, 4, NOW(), NOW() + INTERVAL '3 days', 'Offensive language');
74
75INSERT INTO permissions (name)
76VALUES
77 ('Create Thread'),
78 ('Delete Thread');
79
80INSERT INTO project_roles (name, project_id, description)
81VALUES
82 ('Admin', 5, 'Admin role for the project'),
83 ('Developer', 5, 'Developer role for the project');
84
85INSERT INTO users_project_roles (user_id, project_id, role_name)
86VALUES
87 (3, 5, 'Admin'),
88 (2, 5, 'Developer'),
89 (4, 5, 'Developer');
90
91INSERT INTO project_roles_permissions (permission_name, role_name, project_id)
92VALUES
93 ('Create Thread', 'Admin', 5),
94 ('Delete Thread', 'Admin', 5);
95
96
97INSERT INTO report (created_at, description, status, thread_id, for_user_id, by_user_id)
98VALUES
99 (NOW(), 'Inappropriate content', 'PENDING', 3, 2, 1),
100 (NOW(), 'Spam content', 'DENIED', 6, 4, 3);
101
102INSERT INTO channel (name, description, project_id, developer_id)
103VALUES
104 ('Updates', 'Project updates channel', 5, 3);
105
106INSERT INTO messages (sent_at, content, sent_by, project_id, channel_name)
107VALUES
108 (NOW(), 'Hello, team!', 3, 5, 'General'),
109 (NOW(), 'We need to push the deadline.', 3, 5, 'Updates');
110