Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.11 KB | None | 0 0
  1. -- Types
  2.  
  3. DROP TYPE IF EXISTS "priority" CASCADE;
  4. DROP TYPE IF EXISTS task_status CASCADE;
  5. DROP TYPE IF EXISTS invite_status CASCADE;
  6. DROP TYPE IF EXISTS report_reason CASCADE;
  7. DROP TYPE IF EXISTS event_type CASCADE;
  8. DROP TYPE IF EXISTS report_type CASCADE;
  9. DROP TYPE IF EXISTS log_types CASCADE;
  10.  
  11. DROP TABLE IF EXISTS users CASCADE;
  12. DROP TABLE IF EXISTS courses CASCADE;
  13. DROP TABLE IF EXISTS course_units CASCADE;
  14. DROP TABLE IF EXISTS course_unit_users CASCADE;
  15. DROP TABLE IF EXISTS faculties CASCADE;
  16. DROP TABLE IF EXISTS faculty_courses CASCADE;
  17. DROP TABLE IF EXISTS rooms CASCADE;
  18. DROP TABLE IF EXISTS events CASCADE;
  19. DROP TABLE IF EXISTS event_rooms CASCADE;
  20. DROP TABLE IF EXISTS threads CASCADE;
  21. DROP TABLE IF EXISTS thread_responses CASCADE;
  22. DROP TABLE IF EXISTS reports CASCADE;
  23. DROP TABLE IF EXISTS workgroups CASCADE;
  24. DROP TABLE IF EXISTS workgroup_collaborators CASCADE;
  25. DROP TABLE IF EXISTS taskgroups CASCADE;
  26. DROP TABLE IF EXISTS tasks CASCADE;
  27. DROP TABLE IF EXISTS task_responsible CASCADE;
  28. DROP TABLE IF EXISTS subscribed_user_tasks CASCADE;
  29. DROP TABLE IF EXISTS logs CASCADE;
  30. DROP TABLE IF EXISTS notifications CASCADE;
  31. DROP TABLE IF EXISTS invites CASCADE;
  32. DROP TABLE IF EXISTS invited_users CASCADE;
  33. DROP TABLE IF EXISTS course_units CASCADE;
  34. DROP TABLE IF EXISTS course_unit_votes CASCADE;
  35. DROP TABLE IF EXISTS exam_rooms CASCADE;
  36. DROP TABLE IF EXISTS group_request_respondents CASCADE;
  37.  
  38. CREATE TYPE "priority" AS ENUM ('High', 'Medium', 'Low');
  39. CREATE TYPE task_status AS ENUM ('To do', 'Done');
  40. CREATE TYPE invite_status AS ENUM ('Accepted', 'Rejected', 'Pending');
  41. CREATE TYPE report_reason AS ENUM ('Inappropriate', 'Offensive', 'Spam', 'Not relevant', 'Other');
  42. CREATE TYPE event_type AS ENUM ('Delivery', 'Exam', 'Other');
  43. CREATE TYPE report_type AS ENUM ('User', 'Thread', 'ThreadResponse');
  44. CREATE TYPE log_types AS ENUM ('create', 'statusChange');
  45.  
  46. -- Tables
  47.  
  48. /* R1 user */
  49.  
  50. CREATE TABLE users (
  51. id SERIAL PRIMARY KEY,
  52. name text NOT NULL UNIQUE,
  53. email text NOT NULL UNIQUE,
  54. first_name text,
  55. last_name text,
  56. "image" text DEFAULT 'genericUser.png',
  57. bio text,
  58. "password" text NOT NULL,
  59. is_banned BOOLEAN NOT NULL DEFAULT false,
  60. is_admin BOOLEAN NOT NULL DEFAULT false,
  61. is_regent BOOLEAN NOT NULL DEFAULT false,
  62. remember_token VARCHAR
  63. );
  64.  
  65. /* R3 */
  66. CREATE TABLE courses (
  67. id SERIAL PRIMARY KEY,
  68. "name" text NOT NULL,
  69. acronym text
  70. );
  71.  
  72. /* R2 */
  73. CREATE TABLE course_units (
  74. id SERIAL PRIMARY KEY,
  75. "name" text NOT NULL,
  76. acronym text NOT NULL,
  77. "description" text,
  78. program text,
  79. max_members_per_group int NOT NULL,
  80. avg_complexity FLOAT(8),
  81. avg_time_spent FLOAT(8),
  82. avg_difficulty FLOAT(8),
  83. id_course INTEGER REFERENCES courses (id) ON UPDATE CASCADE ON DELETE CASCADE
  84. );
  85.  
  86. /* R16 */
  87. CREATE TABLE course_unit_users (
  88. course_unit_id INTEGER REFERENCES course_units (id) ON UPDATE CASCADE ON DELETE CASCADE,
  89. user_id INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  90. PRIMARY KEY (course_unit_id, user_id)
  91. );
  92.  
  93. /* r4 */
  94.  
  95. CREATE TABLE faculties (
  96. id SERIAL PRIMARY KEY,
  97. name text NOT NULL UNIQUE,
  98. acronym text
  99. );
  100.  
  101. /* R17 */
  102. CREATE TABLE faculty_courses (
  103. id_faculty INTEGER REFERENCES faculties (id) ON UPDATE CASCADE ON DELETE CASCADE,
  104. id_course INTEGER REFERENCES courses (id) ON UPDATE CASCADE ON DELETE CASCADE,
  105. PRIMARY KEY (id_faculty, id_course)
  106. );
  107.  
  108. /* R5 */
  109. CREATE TABLE rooms (
  110. id SERIAL PRIMARY KEY,
  111. designation text NOT NULL,
  112. id_faculty INTEGER REFERENCES faculties (id) ON UPDATE CASCADE ON DELETE CASCADE
  113. );
  114.  
  115. /* R6 */
  116. CREATE TABLE events (
  117. id SERIAL PRIMARY KEY,
  118. "name" text NOT NULL,
  119. "datetime" TIMESTAMP WITH TIME zone DEFAULT now() NOT NULL,
  120. "description" text,
  121. id_course_unit INTEGER REFERENCES course_units (id) ON UPDATE CASCADE ON DELETE CASCADE,
  122. id_faculty INTEGER REFERENCES faculties (id) ON UPDATE CASCADE ON DELETE CASCADE,
  123. type event_type NOT NULL
  124. );
  125.  
  126. /* R18 */
  127. CREATE TABLE exam_rooms (
  128. id_event INTEGER REFERENCES events (id) ON UPDATE CASCADE ON DELETE CASCADE,
  129. id_room INTEGER REFERENCES rooms (id) ON UPDATE CASCADE ON DELETE CASCADE,
  130. PRIMARY KEY (id_event, id_room)
  131. );
  132.  
  133. /* R7 */
  134. CREATE TABLE threads (
  135. id SERIAL PRIMARY KEY,
  136. author INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  137. course_unit_id INTEGER REFERENCES course_units (id) ON UPDATE CASCADE ON DELETE CASCADE,
  138. title text NOT NULL,
  139. "text" text NOT NULL,
  140. "datetime" TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL,
  141. is_deactivated BOOLEAN NOT NULL DEFAULT false
  142. );
  143.  
  144. /* R8 */
  145. CREATE TABLE thread_responses (
  146. id SERIAL PRIMARY KEY,
  147. author INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  148. thread_id INTEGER REFERENCES threads (id) ON UPDATE CASCADE ON DELETE CASCADE,
  149. title text NOT NULL,
  150. "text" text NOT NULL,
  151. "datetime" TIMESTAMP WITH TIME zone DEFAULT now() NOT NULL,
  152. is_deactivated BOOLEAN NOT NULL DEFAULT false
  153. );
  154.  
  155. /* r9 */
  156. CREATE TABLE reports (
  157. id SERIAL PRIMARY KEY,
  158. reporter INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  159. "datetime" TIMESTAMP WITH TIME zone DEFAULT now() NOT NULL,
  160. reason report_reason NOT NULL,
  161. type report_type NOT NULL,
  162. reported_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  163. reported_thread INTEGER REFERENCES threads (id) ON UPDATE CASCADE ON DELETE CASCADE,
  164. reported_thread_response INTEGER REFERENCES thread_responses (id) ON UPDATE CASCADE ON DELETE CASCADE,
  165. analysed BOOLEAN NOT NULL DEFAULT false
  166. );
  167.  
  168. /* R10 */
  169. CREATE TABLE workgroups (
  170. id SERIAL PRIMARY KEY,
  171. coordinator INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  172. course_unit_id INTEGER REFERENCES course_units (id) ON UPDATE CASCADE ON DELETE CASCADE,
  173. "year" INTEGER NOT NULL,
  174. number_members INTEGER,
  175. is_active BOOLEAN NOT NULL DEFAULT true,
  176. is_group_request_active BOOLEAN NOT NULL DEFAULT false,
  177. is_banned BOOLEAN NOT NULL DEFAULT false,
  178. CONSTRAINT CHK_VALUES CHECK (number_members > 0)
  179. );
  180.  
  181. /* R19 */
  182. CREATE TABLE workgroup_collaborators (
  183. workgroup_id INTEGER REFERENCES workgroups (id) ON UPDATE CASCADE ON DELETE CASCADE,
  184. user_id INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  185. PRIMARY KEY (workgroup_id, user_id)
  186. );
  187.  
  188. /* R11 */
  189. CREATE TABLE taskgroups (
  190. id SERIAL PRIMARY KEY,
  191. id_workgroup INTEGER REFERENCES workgroups (id) ON UPDATE CASCADE ON DELETE CASCADE,
  192. title text NOT NULL,
  193. "description" text
  194. );
  195.  
  196. /* R12 */
  197. CREATE TABLE tasks (
  198. id SERIAL PRIMARY KEY,
  199. id_taskgroup INTEGER REFERENCES taskgroups (id) ON UPDATE CASCADE ON DELETE CASCADE,
  200. title text NOT NULL,
  201. "priority" priority NOT NULL,
  202. "status" task_status NOT NULL DEFAULT 'To do',
  203. last_user_to_update INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE
  204. );
  205.  
  206. /* R20 */
  207. CREATE TABLE task_responsible (
  208. id_task INTEGER REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE,
  209. id_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  210. PRIMARY KEY (id_task, id_user)
  211. );
  212.  
  213. /* R21 */
  214. CREATE TABLE subscribed_user_tasks (
  215. id_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  216. id_task INTEGER REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE,
  217. PRIMARY KEY (id_task, id_user)
  218. );
  219.  
  220. /* R13 */
  221. CREATE TABLE logs (
  222. id SERIAL PRIMARY KEY,
  223. "datetime" TIMESTAMP WITH TIME zone DEFAULT now() NOT NULL,
  224. id_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  225. id_task INTEGER REFERENCES tasks (id) ON UPDATE CASCADE ON DELETE CASCADE,
  226. type log_types NOT NULL
  227. );
  228.  
  229. /* R22 */
  230. CREATE TABLE notifications (
  231. id SERIAL PRIMARY KEY,
  232. id_log INTEGER REFERENCES logs (id) ON UPDATE CASCADE ON DELETE CASCADE,
  233. id_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  234. seen BOOLEAN NOT NULL DEFAULT false
  235. );
  236.  
  237. /* R14 */
  238. CREATE TABLE invites (
  239. id SERIAL PRIMARY KEY,
  240. author INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  241. id_workgroup INTEGER REFERENCES workgroups(id) ON UPDATE CASCADE ON DELETE CASCADE,
  242. invited_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  243. "status" invite_status NOT NULL DEFAULT 'Pending'
  244. );
  245.  
  246. /* R23 */
  247. CREATE TABLE course_unit_votes (
  248. id SERIAL PRIMARY KEY,
  249. id_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  250. id_course_unit INTEGER REFERENCES course_units (id) ON UPDATE CASCADE ON DELETE CASCADE,
  251. complexity INTEGER,
  252. time_spent INTEGER,
  253. difficulty INTEGER,
  254. CONSTRAINT CHK_VALUES_VOTE CHECK (complexity>=0 AND complexity<=5 AND time_spent>=0 AND time_spent<=5 AND difficulty>=0 AND difficulty<=5)
  255. );
  256.  
  257. /* R24 */
  258. CREATE TABLE group_request_respondents (
  259. id_user INTEGER REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE,
  260. id_workgroup INTEGER REFERENCES workgroups (id) ON UPDATE CASCADE ON DELETE CASCADE,
  261. PRIMARY KEY (id_user, id_workgroup)
  262. );
  263.  
  264. /* TEST INSERTS */
  265. /* USER */
  266. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  267. VALUES ('TheUserNumber1','admin@sapo.pt','João', 'Morais', 'TheUserNumber1.jpg', 'I am the admin!', '$2y$10$7chZmHlb8kqaucAby14Wg.4h0E7tjeehCx2sLYKSNFzIvIMiWHU9a', FALSE, TRUE, FALSE, NULL); /* hash 123456 */
  268.  
  269. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  270. VALUES ('CatFish','myemail@gmail.com','Maria', 'Moura', 'CatFish.jpg', 'A cat chasing a fish', 'FWSEUIYLB432', FALSE, FALSE, FALSE, NULL);
  271.  
  272. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  273. VALUES ('K-Dot','kdot@gmail.com','Kendrick', 'Duckworth', 'K-Dot.jpg', 'How much a dollar cost', 'UID&WGVFWUD7', FALSE, FALSE, FALSE, NULL);
  274.  
  275. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  276. VALUES ('Madlib','mad@gmail.com','Otis', 'Jackson', 'Madlib.jpg', 'Piñata', 'YDVUJVL87934', FALSE, FALSE, FALSE, NULL);
  277.  
  278. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  279. VALUES ('MF_DOOM','madvillainy@gmail.com','Daniel', 'Dumile', 'MF_DOOM.jpg', 'ALL CAPS WHEN YOU SPELL THE MANS NAME', 'HJBDFV78844', FALSE, FALSE, FALSE, NULL);
  280.  
  281. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  282. VALUES ('Little_Simz','LittleSimz@gmail.com','Simbiatu', 'Ajikawo', 'Little_Simz.jpg', 'GREY Area', 'HJBOUH789996', FALSE, FALSE, FALSE, NULL);
  283.  
  284. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  285. VALUES ('Janelle_Monae','Janelle_Monae@gmail.com','Janelle', 'Robinson', 'Janelle_Monae.jpg', 'Take a Byte', 'OPIWSEUDE932U', FALSE, FALSE, FALSE, NULL);
  286.  
  287. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  288. VALUES ('Jack_White','Jack@gmail.com','John', 'Gillis', 'Jack_White.jpg', NULL, 'OGBC80DWEHJDWU', FALSE, FALSE, FALSE, NULL);
  289.  
  290. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  291. VALUES ('Fever_Ray','itsSoDamnHot@gmail.com','Karin', 'Andersson', 'Fever_Ray.jpg', 'Concrete Walls', 'BIEWDFC876WDCU', FALSE, FALSE, FALSE, NULL);
  292.  
  293. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  294. VALUES ('Frank Ocean','blonde@gmail.com','Christopher', 'Breaux', 'Frank_Ocean.jpg', 'Good Guy', 'BIEPFVE83RFD3HJ', FALSE, FALSE, FALSE, NULL);
  295.  
  296. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  297. VALUES ('JuliaH','jhma@gmail.com','Julia', 'Holter', 'JuliaH.jpg', NULL, 'BYHOGUOG8723EJU', FALSE, FALSE, FALSE, NULL);
  298.  
  299. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  300. VALUES ('Flume','flumeInTheHouse@gmail.com','Harley', 'Streten', 'Flume.jpg', 'Hi this is Flume', 'HIHGIGUOV5657K7', FALSE, FALSE, FALSE, NULL);
  301.  
  302. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  303. VALUES ('Tyler_the_Creator','FlowerBoy@gmail.com','Tyler', 'Okonma', 'Tyler_the_Creator.jpg', 'I AINT GOT TIIIIIIIIIIIIIIIIIIIIIIIIIIIMMMMEEEEEEEEEEEEEEEE', 'G8E90DFVCE98GEOC', FALSE, FALSE, FALSE, NULL);
  304.  
  305. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  306. VALUES ('FranciscoAlves19','falves98@gmail.com','Francisco', 'Alves', 'default.jpg', 'Living my best life... I aint going back and forth with you ninjas', 'K6HL4DFVCE98GEOC', FALSE, FALSE, FALSE, NULL);
  307.  
  308. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  309. VALUES ('DaBaby','Babysitter@gmail.com','Jonathan', 'Kirk', 'Im going baby on baby!!!', 'G8E90DFVCE98GEOC', NULL);
  310.  
  311. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  312. VALUES ('Mariana11','up00000001@fe.up.pt','Mariana', 'Costa', 'Esta é a minha descrição. Não sei o que dizer.', 'PBI560UVNO98KEOC', NULL);
  313.  
  314. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  315. VALUES ('DinisMoreira75','up00000002@fe.up.pt','Dinis', 'Moreira', 'Também não sei o que meter na minha descrição. Feels Bad.', 'FG8E90UVNO98KEOC', NULL);
  316.  
  317. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  318. VALUES ('RicardoMoura','up00000003@fe.up.pt','Ricardo', 'Moura', NULL, 'KA523JUVNO98KEOC', NULL);
  319.  
  320. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  321. VALUES ('JoaoGoncalves17','up00000004@fe.up.pt','João', 'Gonçalves', NULL, '627GH0UVNO98KEOC', NULL);
  322.  
  323. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  324. VALUES ('psousa','up00000005@fe.up.pt','Pedro', 'Sousa', NULL, 'A27GH0UVNO98KEOC', NULL);
  325.  
  326. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  327. VALUES ('JCanas','up00000006@fe.up.pt','João', 'Canas', NULL, 'A27GH0UVNO98KEOC', NULL);
  328.  
  329. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  330. VALUES ('FAlves','up00000007@fe.up.pt','Fernando', 'Alves', NULL, 'B27GH0UVNO98KEOC', NULL);
  331.  
  332. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  333. VALUES ('ACosta','up00000008@fe.up.pt','Ana', 'Costa', NULL, 'C27GH0UVNO98KEOC', NULL);
  334.  
  335. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  336. VALUES ('SMendes','up00000009@fe.up.pt','Sara', 'Mendes', NULL, 'D27GH0UVNO98KEOC', NULL);
  337.  
  338. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  339. VALUES ('JMota','up00000010@fe.up.pt','Joana', 'Mota', NULL, 'E27GH0UVNO98KEOC', NULL);
  340.  
  341. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  342. VALUES ('APaelhas','up00000011@fe.up.pt','Alberto', 'Paelhas', NULL, 'F27GH0UVNO98KEOC', NULL);
  343.  
  344. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  345. VALUES ('JAlb','up00000013@fe.up.pt','Joaquim', 'Alberto', NULL, 'F27GH0UVNO98KEOC', NULL);
  346.  
  347. INSERT INTO users (name, email, first_name, last_name, bio, password, remember_token)
  348. VALUES ('BrunoPer','up00000014@fe.up.pt','Bruno', 'Pereira', NULL, 'F27GH0UVNO98KEOC', NULL);
  349.  
  350. /* courses */
  351.  
  352. INSERT INTO courses ("name", acronym)
  353. VALUES ('Master in Informatics and Computing Engineering','MIEIC');
  354.  
  355. INSERT INTO courses ("name", acronym)
  356. VALUES ('Master in Electrical and Computers Engineering','MIEEC');
  357.  
  358. INSERT INTO courses ("name", acronym)
  359. VALUES ('Master in Bioengineering','MIB');
  360.  
  361. INSERT INTO courses ("name", acronym)
  362. VALUES ('Master Degree in Medicine','MIMED');
  363.  
  364. INSERT INTO courses ("name", acronym)
  365. VALUES ('Master in Economic','ME');
  366.  
  367. INSERT INTO courses ("name", acronym)
  368. VALUES ('Master in Chemical Engineering','MIEQ');
  369.  
  370. INSERT INTO courses ("name", acronym)
  371. VALUES ('Master in Metallurgical and Materials Engineering','MIEMM');
  372.  
  373. INSERT INTO courses ("name", acronym)
  374. VALUES ('Master in Mechanical Engineering','MIEM');
  375.  
  376. INSERT INTO courses ("name", acronym)
  377. VALUES ('Master in Physical Engineering','MIEF');
  378.  
  379. INSERT INTO courses ("name", acronym)
  380. VALUES ('Master in Engineering and Industrial Management','MIEGI');
  381.  
  382. /* course_units */
  383.  
  384. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  385. VALUES ('Compilers','COMP','Provide concepts which allow to: understand the languages’ compilation phases, in particular for imperative and object-oriented (OO) languages; specify the syntax and semantics of a programming language; understand and use the data structures and the main algorithms used to implement compilers.',
  386. NULL, 4, 4.1, 4.2, 4.4, 1);
  387.  
  388. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  389. VALUES ('Artificial Intelligence','IART','This courses provides a set of subjects (topics) that are the core of the Artificial Intelligence and Intelligent System area. The main objectives are: To know what characterizes and distinguishes AI and how to apply it. To know how to automatically represent, acquire, manipulate and apply knowledge using Computational Algorithms and Systems. To develop small projects using AI techniques. Percentual Distribution: Scientific component: 60%; Technological component: 40%',
  390. NULL, 3, 3.9, 4.2, 4.5, 1);
  391.  
  392. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  393. VALUES ('Distributed Systems','SDIS','One of the most important recent developments in computing is the growth of distributed applications, as witnessed by the sheer number of Web-based applications, many of them mobile. This courses unit has to main objectives: give students theoretical knowledge on distributed systems so they can make correct decisions when confronted with the need to implement such a system; provide students with practical knowledge so they can develop applications taking into account potential advantages of distributed environments. Scientific: 50%; Technological: 50%',
  394. NULL, 2, 4.4, 4.5, 4.6, 1);
  395.  
  396. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  397. VALUES ('Database and Web Applications Laboratory','LBAW','The unit aims at revisit the learning outcome of databases and web languages ​​and technologies, providing a practical perspective on this core areas of computer engineering. In this courses, the students will learn how to design and develop web-based information systems backed by database management systems.',
  398. NULL, 4, 4.2, 4.1, 4.0, 1);
  399.  
  400. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  401. VALUES ('Object Oriented Programming Laboratory','LPOO','The unit aims at Develop and enhance object-oriented programming skills, using a modern object-oriented programming language (Java), representative of the languages used for developing application software; Developing object-oriented design skills, employing UML, and upholding good design principles and patterns; Learn to develop applications with graphical user interfaces (GUI) and usage of large software libraries; Acquire the habit of following good practices in software development (iterative development, unit testing, debugging, SCV, refactoring, pair programming, etc.). ',
  402. NULL, 3, 3.2, 4.3, 3.0, 1);
  403.  
  404. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  405. VALUES ('Electronic 2','ELEC2','A primary objective of the courses, the continuation of Electronics 1 -- in which a wide range of subjects was covered in a relatively shallow depth -- is the analysis and design of IC multistage broadband amplifiers, both with CMOS or BJT technology. The frequency response of the amplifiers is addressed in detail. Feedback, its basic topologies, characteristics and stability and compensation issues are also analyzed. The study and analysis of characteristics for some typical topologies with both BJT and CMOS, but also with hybrids - BICMOS In sequence of the studies, the next step is to introduce digital circuits. The switching behavior of devices will be subject of analysis (switching from cut-off to conduction and vice-versa). A brief survey will be given on the different logic families, presenting not only the more recent, but as well as the others introduced in the past for a better perception of the reasons behind alterations suffered along the time.',
  406. NULL, 4, 4.2, 4.1, 4.0, 2);
  407.  
  408. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  409. VALUES ('Bio Chemestry II','BCII','Branch of Biomedical Engineering biomedical instrumentation, processing and analysis of signals and biomedical images, medical devices (external and internal prosthesis), tissue engineering (namely regenerative medicine), telemedicine, bioinformatics, medical robotics (minimally invasive surgery) and bionics.',
  410. NULL, 2, 3.2, 4.3, 3.0, 3);
  411.  
  412. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  413. VALUES ('Microeconomics I','MICI','The onjectives are understanding some basic economic instruments and principles; applying those instruments and principles to some economic problems, mainly individual decision-making problems and market problems.',
  414. NULL, 2, 3.2, 4.3, 4.0, 5);
  415.  
  416. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  417. VALUES ('Macroconomics I','MACI','The courses focuses on (i) basic concepts and measurement of the main macroeconomic variables, (ii) core models for short-term macroeconomic analysis, and (iii) microeconomic foundations for modelling private aggregate demand.',
  418. NULL, 3, 3.8, 4.2, 3.7, 5);
  419.  
  420. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  421. VALUES ('Molecular Genetics', 'GMOL','The main objective of the UC “Molecular Genetics ” is to transmit student the more recent knowledge about the dynamics of the human genome and the mechanisms that allow molecular information transmission from DNA to protein. Indeed, the syllabus is extensively dedicated to molecular mechanisms of maintenance of integrity of the genome, methodology employed for study, diagnostic and gene-based therapies.',
  422. NULL, 1, 3.2, 1.3, 4.0, 4);
  423.  
  424. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  425. VALUES ('Morphophysiology of the Locomotor Apparatus','MAL','At the end of this courses unit, students should :Be acquainted with the general principles of Anatomy, Histology and Physiology. This courses unit will stimulate students’ observation skills by acquainting them with the anatomical, histological and physiological terminology. It will also endow them with description techniques, which will make them apply the adequate terminology;- Be acquainted with the normal structure, both macroscopic and microscopic and the normal function of the locomotor apparatus;To acquire a solid basis of knowledge that can be used in the different fields of morphophysiology, in other courses units and in upcoming clinical activities. ',
  426. NULL, 1, 4.2, 4.6, 5.0, 4);
  427.  
  428. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  429. VALUES ('Computer Programming I','PC I','The aim of this courses is to provide students with fundamental knowledge about Information and Communication Technology (ICT) and, in particular, allow them to develop their skills in computer programming.',
  430. NULL, 1, 4.2, 4.6, 5.0, 10);
  431.  
  432. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  433. VALUES ('Electronics 3','ELEC3','This curricular unit aims at empowering students with the competences of design and analysis of the main signal conditioning analogue and digital functions/modules, i. e., analogue sampling and multiplexing circuits, filters, tuned amplifiers, oscillators and multivibrators, PLL, A/D and D/A converters, and simple logic gates. The theoretical study is complemented in the lab classes with the realization of simulation and experimental work, where the design and characterization of circuits is experienced and functional non-idealities are identified.',
  434. NULL, 1, 4.2, 4.6, 5.0, 2);
  435.  
  436. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  437. VALUES ('Digital Signal Processing','PDSI','This courses aims at motivating students to the fundamental concepts, techniques and tools of analysis and design in Discrete-Time Signal Processing (PDS). A particular emphasis is given to specific topics, notably sampling and reconstruction of signals; the Z transform; the design and realization of digital FIR and IIR filters; the Discrete Fourier Transform (DFT), its properties and fast implementation alternatives (FFT); practical applications of the DFT including correlation studies and spectral analysis; and multirate signal processing combining decimation and interpolation. A related goal is to motivate students to laboratory experimentation comprising the design, testing and validation of practical solutions to selected challenges of discrete signal processing, by adotping an approach of "hands-on" and "learning-by-doing".',
  438. NULL, 1, 4.2, 4.6, 5.0, 2);
  439.  
  440. INSERT INTO course_units ("name", acronym, "description", program, max_members_per_group, avg_complexity, avg_time_spent, avg_difficulty, id_course)
  441. VALUES ('Principles of Telecommunications 1','FTEL1','This courses aims to acquaint students with technical knowledge on important aspects of analog and digital communications. At the same time, it also aims to develop students’ personal and professional skills. Two issues are addressed: Acquisition of technical knowledge: courses themes exposed in tutorial classes include digital transmission of information (quantization, baseband transmission, modulations, synchronization and noise effects in communications). Students will be able to choose the most adequate communication solution and predict problems caused by e.g. intersymbol interference or a high error rate probability. Students get familiar with these concepts in theoretical-practical classes and in laboratory classes; Development of personal and professional attitudes: Exercises and lab assignments contribute to develop students’ “engineering reasoning and problem solving” and “experimentation and knowledge discovery”.',
  442. NULL, 1, 4.2, 4.6, 5.0, 2);
  443.  
  444. /* course_unitsUser */
  445.  
  446. INSERT INTO course_unit_users (course_unit_id, user_id)
  447. VALUES (1,2);
  448.  
  449. INSERT INTO course_unit_users (course_unit_id, user_id)
  450. VALUES (1,4);
  451.  
  452. INSERT INTO course_unit_users (course_unit_id, user_id)
  453. VALUES (2,6);
  454.  
  455. INSERT INTO course_unit_users (course_unit_id, user_id)
  456. VALUES (2,5);
  457.  
  458. INSERT INTO course_unit_users (course_unit_id, user_id)
  459. VALUES (2,9);
  460.  
  461. INSERT INTO course_unit_users (course_unit_id, user_id)
  462. VALUES (3,3);
  463.  
  464. INSERT INTO course_unit_users (course_unit_id, user_id)
  465. VALUES (3,7);
  466.  
  467. INSERT INTO course_unit_users (course_unit_id, user_id)
  468. VALUES (6,10);
  469.  
  470. INSERT INTO course_unit_users (course_unit_id, user_id)
  471. VALUES (6,13);
  472.  
  473. INSERT INTO course_unit_users (course_unit_id, user_id)
  474. VALUES (6,14);
  475.  
  476. INSERT INTO course_unit_users (course_unit_id, user_id)
  477. VALUES (7,11);
  478.  
  479. INSERT INTO course_unit_users (course_unit_id, user_id)
  480. VALUES (7,12);
  481.  
  482. INSERT INTO course_unit_users (course_unit_id, user_id)
  483. VALUES (4,16);
  484.  
  485. INSERT INTO course_unit_users (course_unit_id, user_id)
  486. VALUES (4,17);
  487.  
  488. INSERT INTO course_unit_users (course_unit_id, user_id)
  489. VALUES (4,18);
  490.  
  491. INSERT INTO course_unit_users (course_unit_id, user_id)
  492. VALUES (4,19);
  493.  
  494. INSERT INTO course_unit_users (course_unit_id, user_id)
  495. VALUES (5,16);
  496.  
  497. INSERT INTO course_unit_users (course_unit_id, user_id)
  498. VALUES (5,17);
  499.  
  500. INSERT INTO course_unit_users (course_unit_id, user_id)
  501. VALUES (5,18);
  502.  
  503. INSERT INTO course_unit_users (course_unit_id, user_id)
  504. VALUES (5,19);
  505.  
  506. INSERT INTO course_unit_users (course_unit_id, user_id)
  507. VALUES (8,8);
  508.  
  509. INSERT INTO course_unit_users (course_unit_id, user_id)
  510. VALUES (9,8);
  511.  
  512. INSERT INTO course_unit_users (course_unit_id, user_id)
  513. VALUES (8,10);
  514.  
  515. INSERT INTO course_unit_users (course_unit_id, user_id)
  516. VALUES (9,10);
  517.  
  518. INSERT INTO course_unit_users (course_unit_id, user_id)
  519. VALUES (10,11);
  520.  
  521. INSERT INTO course_unit_users (course_unit_id, user_id)
  522. VALUES (11,11);
  523.  
  524. INSERT INTO course_unit_users (course_unit_id, user_id)
  525. VALUES (10,12);
  526.  
  527. INSERT INTO course_unit_users (course_unit_id, user_id)
  528. VALUES (11,12);
  529.  
  530. INSERT INTO course_unit_users (course_unit_id, user_id)
  531. VALUES (13,10);
  532.  
  533. INSERT INTO course_unit_users (course_unit_id, user_id)
  534. VALUES (14,10);
  535.  
  536. INSERT INTO course_unit_users (course_unit_id, user_id)
  537. VALUES (15,10);
  538.  
  539. /* faculties */
  540.  
  541. INSERT INTO faculties ("name", acronym)
  542. VALUES ('Faculty of Engineering of the University of Porto','FEUP');
  543.  
  544. INSERT INTO faculties ("name", acronym)
  545. VALUES ('Instituto de Ciências Biomédicas Abel Salazar','ICBAS');
  546.  
  547. INSERT INTO faculties ("name", acronym)
  548. VALUES ('Faculty of Medicine','FMUP');
  549.  
  550. INSERT INTO faculties ("name", acronym)
  551. VALUES ('Faculty of Economics','FEP');
  552.  
  553. INSERT INTO faculties ("name", acronym)
  554. VALUES ('Faculty of Architecture','FAUP');
  555.  
  556. INSERT INTO faculties ("name", acronym)
  557. VALUES ('Faculty of Dental Medicine','FMDUP');
  558.  
  559. INSERT INTO faculties ("name", acronym)
  560. VALUES ('Faculty of Fine Arts','FBAUP');
  561.  
  562. INSERT INTO faculties ("name", acronym)
  563. VALUES ('Faculty of Law','FDUP');
  564.  
  565. INSERT INTO faculties ("name", acronym)
  566. VALUES ('Faculty of Letters','FLUP');
  567.  
  568. INSERT INTO faculties ("name", acronym)
  569. VALUES ('Faculty of Nutrition and Food Science','FCNAUP');
  570.  
  571. INSERT INTO faculties ("name", acronym)
  572. VALUES ('Faculty of Pharmacy','FFUP');
  573.  
  574. INSERT INTO faculties ("name", acronym)
  575. VALUES ('Faculty of Psychology and Educational Sciences','FPCEUP');
  576.  
  577. INSERT INTO faculties ("name", acronym)
  578. VALUES ('Faculty of Sciences','FCUP');
  579.  
  580. INSERT INTO faculties ("name", acronym)
  581. VALUES ('Faculty of Sport','FADEUP');
  582.  
  583. /* facultycourses */
  584.  
  585. INSERT INTO faculty_courses (id_faculty, id_course)
  586. VALUES (1,1);
  587.  
  588. INSERT INTO faculty_courses (id_faculty, id_course)
  589. VALUES (1,2);
  590.  
  591. INSERT INTO faculty_courses (id_faculty, id_course)
  592. VALUES (2,3);
  593.  
  594. INSERT INTO faculty_courses (id_faculty, id_course)
  595. VALUES (3,4);
  596.  
  597. INSERT INTO faculty_courses (id_faculty, id_course)
  598. VALUES (4,5);
  599.  
  600. INSERT INTO faculty_courses (id_faculty, id_course)
  601. VALUES (1,6);
  602.  
  603. INSERT INTO faculty_courses (id_faculty, id_course)
  604. VALUES (1,7);
  605.  
  606. INSERT INTO faculty_courses (id_faculty, id_course)
  607. VALUES (1,8);
  608.  
  609. INSERT INTO faculty_courses (id_faculty, id_course)
  610. VALUES (1,9);
  611.  
  612. INSERT INTO faculty_courses (id_faculty, id_course)
  613. VALUES (1,10);
  614.  
  615. /* rooms */
  616.  
  617. INSERT INTO rooms (designation, id_faculty)
  618. VALUES ('B301', 1);
  619.  
  620. INSERT INTO rooms (designation, id_faculty)
  621. VALUES ('D302', 2);
  622.  
  623. INSERT INTO rooms (designation, id_faculty)
  624. VALUES ('B303', 1);
  625.  
  626. INSERT INTO rooms (designation, id_faculty)
  627. VALUES ('B332', 1);
  628.  
  629. INSERT INTO rooms (designation, id_faculty)
  630. VALUES ('H002', 3);
  631.  
  632. INSERT INTO rooms (designation, id_faculty)
  633. VALUES ('H005', 3);
  634.  
  635. INSERT INTO rooms (designation, id_faculty)
  636. VALUES ('105', 4);
  637.  
  638. INSERT INTO rooms (designation, id_faculty)
  639. VALUES ('115', 4);
  640.  
  641. INSERT INTO rooms (designation, id_faculty)
  642. VALUES ('215', 4);
  643.  
  644. INSERT INTO rooms (designation, id_faculty)
  645. VALUES ('123', 5);
  646.  
  647. INSERT INTO rooms (designation, id_faculty)
  648. VALUES ('A23', 6);
  649.  
  650. INSERT INTO rooms (designation, id_faculty)
  651. VALUES ('C3', 7);
  652.  
  653. INSERT INTO rooms (designation, id_faculty)
  654. VALUES ('Z1A', 8);
  655.  
  656. INSERT INTO rooms (designation, id_faculty)
  657. VALUES ('B302', 1);
  658.  
  659. INSERT INTO rooms (designation, id_faculty)
  660. VALUES ('B303', 1);
  661.  
  662. INSERT INTO rooms (designation, id_faculty)
  663. VALUES ('B304', 1);
  664.  
  665. INSERT INTO rooms (designation, id_faculty)
  666. VALUES ('B305', 1);
  667.  
  668. INSERT INTO rooms (designation, id_faculty)
  669. VALUES ('B306', 1);
  670.  
  671. INSERT INTO rooms (designation, id_faculty)
  672. VALUES ('B307', 1);
  673.  
  674. /* event */
  675.  
  676. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  677. VALUES ('Exame de COMP', '20180618 10:34:09 AM', 'The minimum note is 8.0 in a scale 0-20.', 1, 1, 'Exam');
  678.  
  679. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  680. VALUES ('Exame de LPOO', '20181218 02:00:00 PM', 'The minimum note is 7.5 in a scale 0-20.', 1, 1, 'Exam');
  681.  
  682. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  683. VALUES ('LBAW A1 Delivery', '20190308 08:00:00 PM', 'Deliver your project in a zip containing the source code and the relatory.', 1, 1, 'Delivery');
  684.  
  685. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  686. VALUES ('LBAW A2 Delivery', '20190316 08:00:00 PM', 'Deliver your project in a zip containing the source code and the relatory.', 1, 1, 'Delivery');
  687.  
  688. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  689. VALUES ('LBAW A3 Delivery', '20190322 08:00:00 PM', 'Deliver your project in a zip containing the source code and the relatory.', 1, 1, 'Delivery');
  690.  
  691. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  692. VALUES ('LBAW A4 Delivery', '20190408 08:00:00 PM', 'Deliver your project in a zip containing the source code and the relatory.', 1, 1, 'Delivery');
  693.  
  694. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  695. VALUES ('Bio Chemestry II Exam', '20190115 09:30:00 AM', 'The minimum note is 7.0 in a scale 0-20', 7, 2, 'Exam');
  696.  
  697. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  698. VALUES ('MACI Mini-Test 1', '20190115 09:30:00 AM', 'The minimum note is 9.0 in a scale 0-20', 9, 4, 'Exam');
  699.  
  700. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  701. VALUES ('MACI Mini-Test 2', '20190215 09:30:00 AM', 'The minimum note is 5.0 in a scale 0-20', 9, 4, 'Exam');
  702.  
  703. INSERT INTO events ("name", "datetime", "description", id_course_unit, id_faculty, type)
  704. VALUES ('MAL Delivery 1', '20190315 09:30:00 AM', 'Submit in a pdf format', 9, 4, 'Delivery');
  705.  
  706. /* exam_rooms */
  707.  
  708. INSERT INTO exam_rooms (id_event , id_room)
  709. VALUES (1, 1);
  710.  
  711. INSERT INTO exam_rooms (id_event , id_room)
  712. VALUES (2, 4);
  713.  
  714. INSERT INTO exam_rooms (id_event , id_room)
  715. VALUES (7, 2);
  716.  
  717. INSERT INTO exam_rooms (id_event , id_room)
  718. VALUES (8, 7);
  719.  
  720. INSERT INTO exam_rooms (id_event , id_room)
  721. VALUES (9, 9);
  722.  
  723. /* thread */
  724.  
  725. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  726. VALUES (1, 1, 'EXAM', 'Do not exceed the absence limit and obtain a minimum of 40% in the project.', '20180718 10:34:09 AM');
  727.  
  728. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  729. VALUES (1, 1, 'EXAM2', 'Exceed the absence limit and obtain a minimum of 10% in the Exam.', '20180818 10:34:09 AM');
  730.  
  731. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  732. VALUES (3, 4, 'A1-Delivery', 'You can now submit your work. It has to be in a zip format containing only the code you wrote and the pdf with the report. Good Luck.', '20190306 10:34:09 AM');
  733.  
  734. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  735. VALUES (3, 4, 'A2-Delivery', 'You can now submit your work. As in past, your submission has to be in a zip format containing only the code you wrote and the pdf with the report. Good Luck.', '20190316 10:00:00 AM');
  736.  
  737. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  738. VALUES (1, 7, 'EXAM', 'Do not exceed the absence limit and obtain a minimum of 40% in the project.', '20180918 10:34:09 AM');
  739.  
  740. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  741. VALUES (13, 4, 'A3-Delivery', 'You can now submit your work. As in past, your submission has to be in a zip format containing only the code you wrote and the pdf with the report. Good Luck.', '20190320 10:00:00 AM');
  742.  
  743. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  744. VALUES (11, 4, 'A4-Delivery', 'You can now submit your work. As in past, your submission has to be in a zip format containing only the code you wrote and the pdf with the report. Good Luck.', '20190406 10:00:00 AM');
  745.  
  746. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  747. VALUES (10, 4, 'A3: Using Loren ipsum', 'User interfaces of the prototype should resemble as much as possible the intended final product to be more effective. If you dont have plausible content just now, then you may use Loren.', '20190406 10:00:00 AM');
  748.  
  749. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  750. VALUES (9, 4, 'A5: How to represent a PK', 'Notice how the problem was bypassed in the published template by using bold.', '20190406 10:00:00 AM');
  751.  
  752. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  753. VALUES (20, 4, 'A6: Issue with inserts without a specific ID', 'Good evening, If anyone is having an error similar to "duplicate key violates unique constraint" while populating the database, in particular after inserting tuples to a table with specific IDs, and then trying to insert more without specifying an ID (assuming you have "Serial" in the key value), I found this post with an easy fix: https://stackoverflow.com/questions/4448340/postgresql-duplicate-key-violates-unique-constraint. Regards, Group 63', '20190406 10:00:00 AM');
  754.  
  755. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  756. VALUES (10, 4, 'Install laravel/telescope', 'Dear students, If you want to make use of the "telescope" debug tool, you have to update Laravel to version 5.8 and then add laravel/telescope. Have a look at the attached file with our log. -- jlopes', '20190406 10:00:00 AM');
  757.  
  758. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  759. VALUES (10, 4, 'LBAW Component gradings', 'Dear students, The grades of the component ER have been published in the Moodle Components Matrix. -- JCL', '20190406 10:00:00 AM');
  760.  
  761. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  762. VALUES (10, 4, 'Custom Types', 'Dear Students, phpPgAdmin 5.1 installed in the machine (http://dbm.fe.up.pt/phppgadmin/) does not show "Types". Maybe it is better to use pgAdmin4 (https://www.pgadmin.org/) to get the interface shown in Joãos previous message, Actually, pgAdmin is the tool we provide, as a Docker container, in LBAWs framework (come to tomorrows lecture). -- jlopes', '20190406 10:00:00 AM');
  763.  
  764. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  765. VALUES (10, 4, 'Changes to T3 Guide', 'Dear students, Please take into account that the T3 guide was slightly changed, namely the topics 7, 8 and 9 which were added or changed. Have a nice week.', '20190406 10:00:00 AM');
  766.  
  767. INSERT INTO threads (author, course_unit_id, title, "text", "datetime")
  768. VALUES (10, 4, 'Gradings T1', 'Dear students, You can consult in moodle the gradings obtained in assignment T1. Best regards, JPF', '20190406 10:00:00 AM');
  769.  
  770. /* threadResponse */
  771.  
  772. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  773. VALUES (17, 4, 'EXAM', 'Can it be delivered in a rar file?', '20190306 10:54:09 AM');
  774.  
  775. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  776. VALUES (3, 4, 'EXAM2', 'No, it can not', '20190306 12:04:09 AM');
  777.  
  778. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  779. VALUES (18, 1, 'Structure', 'Will the test be in the FEUP computers or do we need to bring ours?', '20180718 11:34:09 AM');
  780.  
  781. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  782. VALUES (1, 1, 'EXAM', 'In the test you will be using FEUP computers, as usual.', '20190119 05:34:09 PM');
  783.  
  784. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  785. VALUES (6, 4, 'IDK', 'Feel Bad', '20190307 12:00:09 AM');
  786.  
  787. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  788. VALUES (14, 1, 'RE', 'rip.', '20190120 12:01:09 AM');
  789.  
  790. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  791. VALUES (14, 2, 'RE', 'ok', '20190120 12:02:09 AM');
  792.  
  793. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  794. VALUES (14, 3, 'RE', 'thanks', '20190120 12:03:09 AM');
  795.  
  796. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  797. VALUES (1, 4, 'RE', 'ok', '20190120 12:04:09 AM');
  798.  
  799. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  800. VALUES (2, 5, 'RE', 'ok', '20190120 12:05:09 AM');
  801.  
  802. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  803. VALUES (3, 6, 'RE', 'ok', '20190120 12:05:09 AM');
  804.  
  805. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  806. VALUES (4, 7, 'RE', 'wow', '20190120 12:05:09 AM');
  807.  
  808. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  809. VALUES (5, 8, 'RE', 'ok', '20190120 12:05:09 AM');
  810.  
  811. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  812. VALUES (6, 9, 'RE', 'hmmm', '20190120 12:05:09 AM');
  813.  
  814. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  815. VALUES (7, 10, 'bot5', 'Imma spam5', '20190120 12:05:09 AM');
  816.  
  817. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  818. VALUES (8, 11, 'bot5', 'Imma spam5', '20190120 12:05:09 AM');
  819.  
  820. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  821. VALUES (9, 12, 'RE', 'thanks', '20190120 12:05:09 AM');
  822.  
  823. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  824. VALUES (10, 13, 'RE', 'ok', '20190120 12:05:09 AM');
  825.  
  826. INSERT INTO thread_responses (author, thread_id, title, "text", "datetime")
  827. VALUES (11, 14, 'RE', 'nice', '20190120 12:05:09 AM');
  828.  
  829. /* report */
  830.  
  831. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  832. VALUES (8, '20190218 10:34:09 AM', 'Inappropriate', 'User', 9,NULL,NULL);
  833.  
  834. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  835. VALUES (4, '20190223 10:00:09 PM', 'Inappropriate', 'User', 9,NULL,NULL);
  836.  
  837. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  838. VALUES (3, '20190318 10:34:09 AM', 'Spam', 'Thread', NULL,4,NULL);
  839.  
  840. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  841. VALUES (13, '20180724 05:34:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,3);
  842.  
  843. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  844. VALUES (12, '20180720 11:34:09 AM', 'Not relevant', 'ThreadResponse', NULL,NULL,3);
  845.  
  846. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response, analysed)
  847. VALUES (12, '20190218 10:34:09 AM', 'Offensive', 'User', 9,NULL,NULL,true);
  848.  
  849. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  850. VALUES (2, '20190121 10:35:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,5);
  851.  
  852. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  853. VALUES (2, '20190121 10:36:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,6);
  854.  
  855. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  856. VALUES (2, '20190121 10:37:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,7);
  857.  
  858. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  859. VALUES (2, '20190121 10:38:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,8);
  860.  
  861. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  862. VALUES (2, '20190121 10:39:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,9);
  863.  
  864. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  865. VALUES (2, '20190121 10:40:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,10);
  866.  
  867. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  868. VALUES (7, '20190121 10:44:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,5);
  869.  
  870. INSERT INTO reports (reporter, "datetime", reason, type, reported_user, reported_thread, reported_thread_response)
  871. VALUES (7, '20190121 10:54:09 AM', 'Spam', 'ThreadResponse', NULL,NULL,6);
  872.  
  873. /* workgroup */
  874.  
  875. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active, is_group_request_active, is_banned)
  876. VALUES (8, 1, 2018, 2, FALSE,false,true);
  877.  
  878. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active,is_group_request_active)
  879. VALUES (16, 4, 2019, 4, FALSE, false);
  880.  
  881. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active,is_group_request_active)
  882. VALUES (11, 11, 2019,1, FALSE, false);
  883.  
  884. INSERT INTO workgroups (coordinator, course_unit_id, "year",number_members, is_active, is_group_request_active)
  885. VALUES (12, 11, 2019, 1, FALSE, false);
  886.  
  887. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active,is_group_request_active)
  888. VALUES (2, 2, 2016, 3, FALSE,false);
  889.  
  890. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active,is_group_request_active)
  891. VALUES (1, 2, 2019, 3, FALSE, false);
  892.  
  893.  
  894. /* workgroupCollaborator */
  895.  
  896. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  897. VALUES (1, 4);
  898.  
  899. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  900. VALUES (1, 2);
  901.  
  902. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  903. VALUES (1, 3);
  904.  
  905. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  906. VALUES (2, 17);
  907.  
  908. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  909. VALUES (2, 18);
  910.  
  911. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  912. VALUES (2, 19);
  913.  
  914. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  915. VALUES (3, 1);
  916.  
  917. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  918. VALUES (5, 14);
  919.  
  920. INSERT INTO workgroup_collaborators (workgroup_id, user_id)
  921. VALUES (5, 15);
  922.  
  923. /* taskGroup */
  924.  
  925. INSERT INTO taskgroups (id_workgroup, title, "description")
  926. VALUES (1, 'Delivery1', 'Mockups');
  927.  
  928. INSERT INTO taskgroups (id_workgroup, title, "description")
  929. VALUES (2, 'A1', 'Project presentation');
  930.  
  931. INSERT INTO taskgroups (id_workgroup, title, "description")
  932. VALUES (2, 'A2', 'Actors and User stories');
  933.  
  934. INSERT INTO taskgroups (id_workgroup, title, "description")
  935. VALUES (2, 'A3', 'User Interfaces Design');
  936.  
  937. INSERT INTO taskgroups (id_workgroup, title, "description")
  938. VALUES (2, 'A4', 'Implementation of the user interfaces');
  939.  
  940. INSERT INTO taskgroups (id_workgroup, title, "description")
  941. VALUES (3, 'Delivery1', 'Mockups');
  942.  
  943. INSERT INTO taskgroups (id_workgroup, title, "description")
  944. VALUES (3, 'Delivery2', 'Work');
  945.  
  946. INSERT INTO taskgroups (id_workgroup, title, "description")
  947. VALUES (4, 'Delivery1', 'Mockups');
  948.  
  949. INSERT INTO taskgroups (id_workgroup, title, "description")
  950. VALUES (4, 'Delivery2', 'Work');
  951.  
  952. INSERT INTO taskgroups (id_workgroup, title, "description")
  953. VALUES (5, 'SONG1', 'MUSIC');
  954.  
  955. INSERT INTO taskgroups (id_workgroup, title, "description")
  956. VALUES (5, 'SONG2', 'MUSIC');
  957.  
  958. INSERT INTO taskgroups (id_workgroup, title, "description")
  959. VALUES (5, 'Album', 'MUSIC');
  960.  
  961. /* task */
  962.  
  963. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  964. VALUES (1, 'homepage', 'High', 'To do', 1);
  965.  
  966. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  967. VALUES (2, 'Work Description', 'High', 17);
  968.  
  969. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  970. VALUES (3, 'Actors', 'Medium', 16);
  971.  
  972. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  973. VALUES (3, 'User Stories', 'High', 18);
  974.  
  975. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  976. VALUES (3, 'Annex: Supplementary requirements', 'Low', 19);
  977.  
  978. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  979. VALUES (4, 'Interface and common features', 'High', 16);
  980.  
  981. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  982. VALUES (4, 'Sitemap', 'High', 17);
  983.  
  984. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  985. VALUES (4, 'Storyboards', 'Medium', 18);
  986.  
  987. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  988. VALUES (4, 'Interfaces', 'High', 19);
  989.  
  990. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  991. VALUES (4, 'Code Development', 'High', 18);
  992.  
  993. INSERT INTO tasks (id_taskgroup, title, "priority", last_user_to_update)
  994. VALUES (5, 'Conceptual Data Model', 'High', 17);
  995.  
  996. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  997. VALUES (6, 'mockup', 'High', 'To do', 11);
  998.  
  999. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1000. VALUES (7, 'draw', 'Medium', 'To do', 11);
  1001.  
  1002. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1003. VALUES (7, 'implement', 'High', 'To do', 11);
  1004.  
  1005. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1006. VALUES (8, 'mockup', 'High', 'To do', 12);
  1007.  
  1008. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1009. VALUES (9, 'Introduction', 'Low', 'To do', 12);
  1010.  
  1011. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1012. VALUES (9, 'draw+implement', 'High', 'To do', 12);
  1013.  
  1014. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1015. VALUES (9, 'Conclusion', 'Medium', 'To do', 12);
  1016.  
  1017. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1018. VALUES (8, 'populate', 'Medium', 'To do', 12);
  1019.  
  1020. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1021. VALUES (6, 'populate', 'Medium', 'To do', 11);
  1022.  
  1023. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1024. VALUES (7, 'Conclusion', 'Low', 'To do', 11);
  1025.  
  1026. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1027. VALUES (7, 'Conclusion', 'Low', 'To do', 11);
  1028.  
  1029. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1030. VALUES (10, 'Lyrics', 'Low', 'To do', 15);
  1031.  
  1032. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1033. VALUES (10, 'Beat', 'High', 'To do', 14);
  1034.  
  1035. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1036. VALUES (11, 'Lyrics', 'High', 'To do', 2);
  1037.  
  1038. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1039. VALUES (11, 'Beat', 'Low', 'To do', 2);
  1040.  
  1041. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1042. VALUES (12, 'Production', 'High', 'To do', 14);
  1043.  
  1044. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1045. VALUES (12, 'Publicity', 'Medium', 'To do', 2);
  1046.  
  1047. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1048. VALUES (12, 'Label', 'High', 'To do', 15);
  1049.  
  1050. INSERT INTO tasks (id_taskgroup, title, "priority", "status", last_user_to_update)
  1051. VALUES (12, 'Release-Date', 'Low', 'To do', 2);
  1052. /* taskResponsible */
  1053.  
  1054. INSERT INTO task_responsible(id_task, id_user)
  1055. VALUES (1, 1);
  1056.  
  1057. INSERT INTO task_responsible(id_task, id_user)
  1058. VALUES (2, 19);
  1059.  
  1060. INSERT INTO task_responsible(id_task, id_user)
  1061. VALUES (3, 18);
  1062.  
  1063. INSERT INTO task_responsible(id_task, id_user)
  1064. VALUES (4, 16);
  1065.  
  1066. INSERT INTO task_responsible(id_task, id_user)
  1067. VALUES (5, 17);
  1068.  
  1069. INSERT INTO task_responsible(id_task, id_user)
  1070. VALUES (6, 18);
  1071.  
  1072. INSERT INTO task_responsible(id_task, id_user)
  1073. VALUES (7, 17);
  1074.  
  1075. INSERT INTO task_responsible(id_task, id_user)
  1076. VALUES (8, 19);
  1077.  
  1078. INSERT INTO task_responsible(id_task, id_user)
  1079. VALUES (9, 16);
  1080.  
  1081. INSERT INTO task_responsible(id_task, id_user)
  1082. VALUES (10, 16);
  1083.  
  1084. INSERT INTO task_responsible(id_task, id_user)
  1085. VALUES (10, 17);
  1086.  
  1087. INSERT INTO task_responsible(id_task, id_user)
  1088. VALUES (10, 18);
  1089.  
  1090. INSERT INTO task_responsible(id_task, id_user)
  1091. VALUES (10, 19);
  1092.  
  1093. INSERT INTO task_responsible(id_task, id_user)
  1094. VALUES (11, 17);
  1095.  
  1096. INSERT INTO task_responsible(id_task, id_user)
  1097. VALUES (12, 11);
  1098.  
  1099. INSERT INTO task_responsible(id_task, id_user)
  1100. VALUES (13, 11);
  1101.  
  1102. INSERT INTO task_responsible(id_task, id_user)
  1103. VALUES (14, 11);
  1104.  
  1105. INSERT INTO task_responsible(id_task, id_user)
  1106. VALUES (15, 12);
  1107.  
  1108. INSERT INTO task_responsible(id_task, id_user)
  1109. VALUES (16, 12);
  1110.  
  1111. INSERT INTO task_responsible(id_task, id_user)
  1112. VALUES (17, 12);
  1113.  
  1114. INSERT INTO task_responsible(id_task, id_user)
  1115. VALUES (18, 12);
  1116.  
  1117. INSERT INTO task_responsible(id_task, id_user)
  1118. VALUES (19, 12);
  1119.  
  1120. INSERT INTO task_responsible(id_task, id_user)
  1121. VALUES (20, 11);
  1122.  
  1123. INSERT INTO task_responsible(id_task, id_user)
  1124. VALUES (21, 11);
  1125.  
  1126. INSERT INTO task_responsible(id_task, id_user)
  1127. VALUES (22, 11);
  1128.  
  1129. INSERT INTO task_responsible(id_task, id_user)
  1130. VALUES (23, 2);
  1131.  
  1132. INSERT INTO task_responsible(id_task, id_user)
  1133. VALUES (24, 2);
  1134.  
  1135. INSERT INTO task_responsible(id_task, id_user)
  1136. VALUES (25, 15);
  1137.  
  1138. INSERT INTO task_responsible(id_task, id_user)
  1139. VALUES (26, 2);
  1140.  
  1141. INSERT INTO task_responsible(id_task, id_user)
  1142. VALUES (27, 2);
  1143.  
  1144. INSERT INTO task_responsible(id_task, id_user)
  1145. VALUES (28, 14);
  1146.  
  1147. INSERT INTO task_responsible(id_task, id_user)
  1148. VALUES (29, 14);
  1149.  
  1150. INSERT INTO task_responsible(id_task, id_user)
  1151. VALUES (30, 15);
  1152.  
  1153. /* subscribedUserTask */
  1154.  
  1155. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1156. VALUES (1, 1);
  1157.  
  1158. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1159. VALUES (16, 3);
  1160.  
  1161. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1162. VALUES (16, 2);
  1163.  
  1164. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1165. VALUES (16, 5);
  1166.  
  1167. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1168. VALUES (16, 10);
  1169.  
  1170. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1171. VALUES (17, 10);
  1172.  
  1173. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1174. VALUES (17, 3);
  1175.  
  1176. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1177. VALUES (17, 6);
  1178.  
  1179. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1180. VALUES (18, 10);
  1181.  
  1182. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1183. VALUES (18, 11);
  1184.  
  1185. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1186. VALUES (18, 9);
  1187.  
  1188. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1189. VALUES (18, 5);
  1190.  
  1191. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1192. VALUES (19, 10);
  1193.  
  1194. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1195. VALUES (19, 3);
  1196.  
  1197. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1198. VALUES (19, 2);
  1199.  
  1200. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1201. VALUES (11, 12);
  1202.  
  1203. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1204. VALUES (11, 14);
  1205.  
  1206. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1207. VALUES (12, 15);
  1208.  
  1209. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1210. VALUES (12, 16);
  1211.  
  1212. INSERT INTO subscribed_user_tasks(id_user, id_task)
  1213. VALUES (12, 18);
  1214.  
  1215. /* log */
  1216.  
  1217. INSERT INTO logs ("datetime", id_user, id_task, type)
  1218. VALUES ('20190218 10:34:09 AM', 1,1, 'create');
  1219.  
  1220. INSERT INTO logs ("datetime", id_user, id_task, type)
  1221. VALUES ('20190325 10:34:09 AM', 17,10, 'create');
  1222.  
  1223. INSERT INTO logs ("datetime", id_user, id_task, type)
  1224. VALUES ('20190327 10:15:00 PM', 19,10, 'statusChange');
  1225.  
  1226. INSERT INTO logs ("datetime", id_user, id_task, type)
  1227. VALUES ('20190330 10:34:09 AM', 16,6, 'create');
  1228.  
  1229. INSERT INTO logs ("datetime", id_user, id_task, type)
  1230. VALUES ('20190305 10:34:09 AM', 17,11, 'create');
  1231.  
  1232. INSERT INTO logs ("datetime", id_user, id_task, type)
  1233. VALUES ('20190305 12:34:09 AM', 11, 12, 'create');
  1234.  
  1235. INSERT INTO logs ("datetime", id_user, id_task, type)
  1236. VALUES ('20190305 12:34:09 AM', 11, 12, 'statusChange');
  1237.  
  1238. INSERT INTO logs ("datetime", id_user, id_task, type)
  1239. VALUES ('20190310 12:34:09 AM', 11, 12, 'statusChange');
  1240.  
  1241. INSERT INTO logs ("datetime", id_user, id_task, type)
  1242. VALUES ('20190310 12:04:09 AM', 12, 16, 'create');
  1243.  
  1244. INSERT INTO logs ("datetime", id_user, id_task, type)
  1245. VALUES ('20190315 12:04:09 AM', 12, 18, 'create');
  1246.  
  1247. /* notification */
  1248.  
  1249. INSERT INTO notifications (id_log, id_user)
  1250. VALUES (1, 1);
  1251.  
  1252. INSERT INTO notifications (id_log, id_user)
  1253. VALUES (2, 16);
  1254.  
  1255. INSERT INTO notifications (id_log, id_user)
  1256. VALUES (2, 17);
  1257.  
  1258. INSERT INTO notifications (id_log, id_user)
  1259. VALUES (2, 18);
  1260.  
  1261. INSERT INTO notifications (id_log, id_user)
  1262. VALUES (3, 16);
  1263.  
  1264. INSERT INTO notifications (id_log, id_user)
  1265. VALUES (3, 17);
  1266.  
  1267. INSERT INTO notifications (id_log, id_user)
  1268. VALUES (3, 18);
  1269.  
  1270. INSERT INTO notifications (id_log, id_user)
  1271. VALUES (3, 19);
  1272.  
  1273. INSERT INTO notifications (id_log, id_user)
  1274. VALUES (5, 18);
  1275.  
  1276. INSERT INTO notifications (id_log, id_user)
  1277. VALUES (4, 19);
  1278.  
  1279. INSERT INTO notifications (id_log, id_user)
  1280. VALUES (6, 11);
  1281.  
  1282. INSERT INTO notifications (id_log, id_user)
  1283. VALUES (7, 11);
  1284.  
  1285. INSERT INTO notifications (id_log, id_user)
  1286. VALUES (8, 11);
  1287.  
  1288. INSERT INTO notifications (id_log, id_user)
  1289. VALUES (9, 12);
  1290.  
  1291. INSERT INTO notifications (id_log, id_user)
  1292. VALUES (10, 12);
  1293.  
  1294. /* invite */
  1295.  
  1296. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1297. VALUES (8, 1, 3,'Accepted');
  1298.  
  1299. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1300. VALUES (8, 1, 5,'Pending');
  1301.  
  1302. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1303. VALUES (8, 1, 9,'Pending');
  1304.  
  1305. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1306. VALUES (16, 1, 19,'Accepted');
  1307.  
  1308. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1309. VALUES (16, 1, 4,'Rejected');
  1310.  
  1311. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1312. VALUES (16, 1, 7,'Rejected');
  1313.  
  1314. INSERT INTO invites(author, id_workgroup, invited_user, "status")
  1315. VALUES (17, 2, 3,'Rejected');
  1316.  
  1317. /* course_unitsVote */
  1318.  
  1319. INSERT INTO course_unit_votes(id_user, id_course_unit, complexity, time_spent, difficulty)
  1320. VALUES (3, 3, 5.0, 4.2, 4.3);
  1321.  
  1322. INSERT INTO course_unit_votes(id_user, id_course_unit, complexity, time_spent, difficulty)
  1323. VALUES (17, 4, 2.0, 2.2, 1.3);
  1324.  
  1325. INSERT INTO course_unit_votes(id_user, id_course_unit, complexity, time_spent, difficulty)
  1326. VALUES (18, 4, 5.0, 4.5, 2.3);
  1327.  
  1328. INSERT INTO course_unit_votes(id_user, id_course_unit, complexity, time_spent, difficulty)
  1329. VALUES (17, 4, 2.6, 3.1, 3.3);
  1330.  
  1331. INSERT INTO course_unit_votes(id_user, id_course_unit, complexity, time_spent, difficulty)
  1332. VALUES (19, 4, 3.0, 2.2, 3.9);
  1333.  
  1334. /* groupRequestRespondent */
  1335.  
  1336. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1337. VALUES (1, 1);
  1338.  
  1339. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1340. VALUES (3, 1);
  1341.  
  1342. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1343. VALUES (7, 1);
  1344.  
  1345. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1346. VALUES (7, 2);
  1347.  
  1348. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1349. VALUES (3, 2);
  1350.  
  1351. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1352. VALUES (4, 2);
  1353.  
  1354. INSERT INTO group_request_respondents (id_user, id_workgroup)
  1355. VALUES (19, 2);
  1356.  
  1357. /* BANNED */
  1358.  
  1359. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  1360. VALUES ('JuliaHa','jhmaa@gmail.com','Julia', 'Holter', 'JuliaH.jpg', NULL, 'BYHOGUOG8723EJU', true, FALSE, FALSE, NULL);
  1361.  
  1362. INSERT INTO users (name, email, first_name, last_name , image, bio, password, is_banned, is_admin, is_regent, remember_token)
  1363. VALUES ('Flumea','flumeaInTheHouse@gmail.com','Harley', 'Streten', 'Flume.jpg', 'Hi this is Flume', 'HIHGIGUOV5657K7', true, FALSE, FALSE, NULL);
  1364.  
  1365.  
  1366. INSERT INTO threads (author, course_unit_id, title, "text", "datetime",is_deactivated)
  1367. VALUES (1, 1, 'EXAM', 'Do not exceed the absence limit and obtain a minimum of 40% in the project.', '20180718 10:34:09 AM',true);
  1368.  
  1369. INSERT INTO threads (author, course_unit_id, title, "text", "datetime",is_deactivated)
  1370. VALUES (1, 1, 'EXAM2', 'Exceed the absence limit and obtain a minimum of 10% in the Exam.', '20180818 10:34:09 AM',true);
  1371.  
  1372.  
  1373. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active, is_group_request_active, is_banned)
  1374. VALUES (8, 1, 2018, 2, FALSE,false,true);
  1375.  
  1376. INSERT INTO workgroups (coordinator, course_unit_id, "year", number_members, is_active,is_group_request_active,is_banned)
  1377. VALUES (16, 4, 2019, 4, FALSE, false,true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement