1 | INSERT INTO users (username, is_activate, password, description, registered_at, sex)
|
---|
2 | VALUES
|
---|
3 | ('user1', true, 'password1', 'First user', NOW(), 'M'),
|
---|
4 | ('user2', true, 'password2', 'Second user', NOW(), 'F'),
|
---|
5 | ('user3', true, 'password3', 'Third user', NOW(), 'M'),
|
---|
6 | ('user4', true, 'password4', 'Fourth user', NOW(), 'F'),
|
---|
7 | ('user5', true, 'password5', 'Fifth user', NOW(), 'M');
|
---|
8 |
|
---|
9 | INSERT INTO thread (content, user_id)
|
---|
10 | VALUES
|
---|
11 | ('Main content for topic thread 1', 1),
|
---|
12 | ('Main content for topic thread 2', 2),
|
---|
13 | ('Discussion content for topic 1', 1),
|
---|
14 | ('Discussion content for topic 2', 2),
|
---|
15 | ('Project-specific thread content', 3),
|
---|
16 | ('Reply to topic 1', 4),
|
---|
17 | ('Further discussion on topic 2', 5);
|
---|
18 |
|
---|
19 | INSERT INTO topic_thread (id, title, guidelines, parent_id)
|
---|
20 | VALUES
|
---|
21 | (1, 'Topic 1', '{"rule1": "Follow guidelines"}', NULL),
|
---|
22 | (2, 'Topic 2', '{"rule2": "Be respectful"}', NULL);
|
---|
23 |
|
---|
24 | INSERT INTO discussion_thread (id, parent_id)
|
---|
25 | VALUES
|
---|
26 | (3, 1),
|
---|
27 | (4, 2),
|
---|
28 | (6, 3),
|
---|
29 | (7, 4);
|
---|
30 |
|
---|
31 | INSERT INTO project_thread (id, title, repo_url)
|
---|
32 | VALUES
|
---|
33 | (5, 'Project 1 Thread', 'http://github.com/project1');
|
---|
34 |
|
---|
35 | INSERT INTO likes (user_id, thread_id)
|
---|
36 | VALUES
|
---|
37 | (1, 3),
|
---|
38 | (2, 4),
|
---|
39 | (3, 5),
|
---|
40 | (4, 6),
|
---|
41 | (5, 7);
|
---|
42 |
|
---|
43 | INSERT INTO tag (name)
|
---|
44 | VALUES
|
---|
45 | ('Tag1'),
|
---|
46 | ('Tag2'),
|
---|
47 | ('Tag3');
|
---|
48 |
|
---|
49 | INSERT INTO tag_threads (thread_id, tag_name)
|
---|
50 | VALUES
|
---|
51 | (1, 'Tag1'),
|
---|
52 | (3, 'Tag2'),
|
---|
53 | (5, 'Tag3'),
|
---|
54 | (6, 'Tag1');
|
---|
55 |
|
---|
56 | INSERT INTO topic_belongs_to_project (topic_id, project_id)
|
---|
57 | VALUES
|
---|
58 | (1, 5),
|
---|
59 | (2, 5);
|
---|
60 |
|
---|
61 | INSERT INTO blacklisted_user (topic_id, user_id, moderator_id, start_date, end_date, reason)
|
---|
62 | VALUES
|
---|
63 | (1, 2, 1, NOW(), NOW() + INTERVAL '7 days', 'Spamming'),
|
---|
64 | (2, 3, 4, NOW(), NOW() + INTERVAL '3 days', 'Offensive language');
|
---|
65 |
|
---|
66 | INSERT INTO developer_associated_with_project (project_id, developer_id, started_at)
|
---|
67 | VALUES
|
---|
68 | (5, 2, NOW()),
|
---|
69 | (5, 3, NOW());
|
---|
70 |
|
---|
71 | INSERT INTO permissions (name)
|
---|
72 | VALUES
|
---|
73 | ('Create Thread'),
|
---|
74 | ('Delete Thread');
|
---|
75 |
|
---|
76 | INSERT INTO project_roles (name, project_id, description)
|
---|
77 | VALUES
|
---|
78 | ('Admin', 5, 'Admin role for the project'),
|
---|
79 | ('Developer', 5, 'Developer role for the project');
|
---|
80 |
|
---|
81 | INSERT INTO users_project_roles (user_id, project_id, role_name)
|
---|
82 | VALUES
|
---|
83 | (3, 5, 'Admin'),
|
---|
84 | (2, 5, 'Developer'),
|
---|
85 | (4, 5, 'Developer');
|
---|
86 |
|
---|
87 | INSERT INTO project_roles_permissions (permission_name, role_name, project_id)
|
---|
88 | VALUES
|
---|
89 | ('Create Thread', 'Admin', 5),
|
---|
90 | ('Delete Thread', 'Admin', 5);
|
---|
91 |
|
---|
92 | INSERT INTO project_request (description, status, user_id, project_id)
|
---|
93 | VALUES
|
---|
94 | ('Request to join Project 1', 'PENDING', 2, 5),
|
---|
95 | ('Request to join Project 1', 'ACCEPTED', 4, 5);
|
---|
96 |
|
---|
97 | INSERT INTO report (created_at, description, status, thread_id, for_user_id, by_user_id)
|
---|
98 | VALUES
|
---|
99 | (NOW(), 'Inappropriate content', 'PENDING', 3, 2, 1),
|
---|
100 | (NOW(), 'Spam content', 'DENIED', 6, 4, 3);
|
---|
101 |
|
---|
102 | INSERT INTO channel (name, description, project_id, developer_id)
|
---|
103 | VALUES
|
---|
104 | ('General', 'General discussion channel', 5, 2),
|
---|
105 | ('Updates', 'Project updates channel', 5, 3);
|
---|
106 |
|
---|
107 | INSERT INTO messages (sent_at, content, sent_by, project_id, channel_name)
|
---|
108 | VALUES
|
---|
109 | (NOW(), 'Hello, team!', 2, 5, 'General'),
|
---|
110 | (NOW(), 'We need to push the deadline.', 3, 5, 'Updates');
|
---|