Skip to content

Commit

Permalink
add user_id for course_reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
fey committed Apr 27, 2023
1 parent 04b0557 commit 94f54e5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 49 deletions.
98 changes: 49 additions & 49 deletions course_reviews.sql
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (19, 1, '2023-04-25 06:17:45.155', 1, 4, 62);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (22, 2, '2023-04-25 01:03:46.399', 2, 4, 66);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (46, 3, '2023-04-25 21:38:39.817', 3, 3, 64);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (40, 4, '2023-04-25 00:22:02.863', 4, 3, 43);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (5, 5, '2023-04-24 22:36:27.486', 5, 4, 98);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (19, 6, '2023-04-25 12:00:07.973', 6, 2, 90);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (52, 7, '2023-04-25 01:47:03.271', 7, 3, 6);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (93, 8, '2023-04-25 12:43:45.288', 8, 5, 8);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (58, 9, '2023-04-25 07:29:36.895', 9, 1, 82);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (62, 10, '2023-04-25 16:32:16.047', 10, 5, 4);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (38, 11, '2023-04-25 06:08:45.064', 11, 4, 99);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (4, 12, '2023-04-25 10:07:18.317', 12, 4, 30);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (65, 13, '2023-04-25 09:58:31.428', 13, 5, 99);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (95, 14, '2023-04-25 02:28:51.918', 14, 4, 64);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (94, 15, '2023-04-25 07:45:14.950', 15, 4, 99);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (92, 16, '2023-04-25 14:09:31.171', 16, 2, 99);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (38, 17, '2023-04-25 18:31:55.518', 17, 1, 87);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (85, 18, '2023-04-25 05:07:09.127', 18, 1, 43);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (19, 19, '2023-04-25 21:53:19.752', 19, 5, 23);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (76, 20, '2023-04-25 13:32:09.894', 20, 3, 97);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (74, 21, '2023-04-25 07:48:09.528', 21, 4, 75);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (20, 22, '2023-04-25 05:38:22.233', 22, 3, 12);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (66, 23, '2023-04-25 16:33:18.313', 23, 3, 78);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (12, 24, '2023-04-25 16:45:30.098', 24, 4, 93);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (6, 25, '2023-04-25 06:15:49.426', 25, 2, 66);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (56, 26, '2023-04-25 15:45:55.986', 26, 4, 2);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (28, 27, '2023-04-25 16:32:02.696', 27, 5, 14);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (37, 28, '2023-04-25 03:15:26.040', 28, 4, 6);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (51, 29, '2023-04-25 14:25:20.342', 29, 3, 44);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (52, 30, '2023-04-25 17:48:25.846', 30, 1, 7);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (9, 31, '2023-04-24 22:55:32.831', 31, 4, 19);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (5, 32, '2023-04-24 22:57:15.029', 32, 1, 71);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (37, 33, '2023-04-25 10:13:04.889', 33, 1, 92);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (27, 34, '2023-04-25 11:26:22.792', 34, 5, 31);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (70, 35, '2023-04-25 18:14:31.302', 35, 4, 95);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (30, 36, '2023-04-25 10:28:36.964', 36, 3, 89);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (25, 37, '2023-04-25 08:21:44.845', 37, 2, 26);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (16, 38, '2023-04-25 20:39:39.184', 38, 2, 25);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (90, 39, '2023-04-25 19:38:12.900', 39, 4, 14);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (20, 40, '2023-04-25 02:59:17.127', 40, 1, 3);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (43, 41, '2023-04-25 04:09:14.386', 41, 1, 81);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (2, 42, '2023-04-25 14:18:45.364', 42, 1, 16);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (60, 43, '2023-04-25 13:55:16.471', 43, 5, 62);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (30, 44, '2023-04-25 18:42:58.235', 44, 5, 1);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (47, 45, '2023-04-25 12:18:24.722', 45, 4, 3);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (94, 46, '2023-04-25 02:53:00.313', 46, 3, 62);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (27, 47, '2023-04-24 23:51:36.046', 47, 1, 25);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (63, 48, '2023-04-25 11:56:25.318', 48, 1, 94);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes") values (27, 49, '2023-04-25 21:58:33.155', 49, 3, 80)
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (67, 1, '2023-04-27 10:18:41.594', 1, 1, 91, 15);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (34, 2, '2023-04-27 11:52:10.732', 2, 3, 14, 62);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (77, 3, '2023-04-26 21:56:30.657', 3, 3, 23, 97);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (81, 4, '2023-04-27 16:31:53.624', 4, 1, 72, 32);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (77, 5, '2023-04-27 09:20:42.964', 5, 3, 70, 4);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (49, 6, '2023-04-27 05:14:03.628', 6, 3, 12, 59);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (90, 7, '2023-04-27 05:26:50.837', 7, 4, 46, 34);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (52, 8, '2023-04-27 10:46:59.960', 8, 1, 21, 41);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (64, 9, '2023-04-27 11:34:28.159', 9, 3, 87, 83);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (46, 10, '2023-04-27 18:37:25.395', 10, 5, 37, 18);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (64, 11, '2023-04-27 09:21:01.149', 11, 3, 3, 66);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (26, 12, '2023-04-27 11:01:59.929', 12, 3, 11, 74);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (77, 13, '2023-04-27 09:41:48.678', 13, 5, 99, 18);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (37, 14, '2023-04-27 12:47:51.108', 14, 1, 7, 4);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (11, 15, '2023-04-27 02:10:28.804', 15, 3, 97, 17);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (34, 16, '2023-04-27 02:34:04.353', 16, 2, 2, 99);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (43, 17, '2023-04-27 19:01:10.425', 17, 5, 70, 72);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (94, 18, '2023-04-27 09:01:41.448', 18, 3, 34, 27);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (34, 19, '2023-04-27 05:00:20.676', 19, 2, 63, 49);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (73, 20, '2023-04-26 22:05:24.571', 20, 4, 48, 35);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (23, 21, '2023-04-27 16:39:25.527', 21, 4, 47, 1);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (20, 22, '2023-04-27 02:45:25.880', 22, 3, 5, 66);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (50, 23, '2023-04-27 07:59:44.605', 23, 2, 84, 77);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (82, 24, '2023-04-27 07:00:00.150', 24, 3, 3, 64);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (17, 25, '2023-04-27 00:37:35.482', 25, 1, 37, 39);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (63, 26, '2023-04-27 11:49:16.570', 26, 4, 73, 60);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (17, 27, '2023-04-27 13:02:26.625', 27, 2, 85, 20);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (78, 28, '2023-04-26 19:33:43.565', 28, 1, 7, 81);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (96, 29, '2023-04-27 14:36:50.651', 29, 5, 23, 21);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (15, 30, '2023-04-26 21:48:15.004', 30, 4, 75, 84);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (97, 31, '2023-04-27 01:52:27.368', 31, 3, 2, 56);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (79, 32, '2023-04-27 15:19:19.399', 32, 3, 29, 4);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (48, 33, '2023-04-27 18:44:41.970', 33, 5, 71, 35);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (86, 34, '2023-04-27 12:16:05.261', 34, 2, 49, 18);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (21, 35, '2023-04-27 01:11:08.166', 35, 3, 80, 4);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (27, 36, '2023-04-27 19:07:33.206', 36, 5, 78, 79);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (25, 37, '2023-04-27 03:46:21.483', 37, 2, 54, 25);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (81, 38, '2023-04-26 20:40:06.420', 38, 1, 79, 98);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (69, 39, '2023-04-26 23:10:54.602', 39, 4, 29, 84);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (44, 40, '2023-04-26 23:32:33.623', 40, 3, 20, 59);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (91, 41, '2023-04-27 09:42:14.385', 41, 4, 29, 64);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (50, 42, '2023-04-27 17:31:44.268', 42, 3, 29, 41);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (11, 43, '2023-04-27 11:21:09.267', 43, 5, 3, 53);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (22, 44, '2023-04-27 05:05:08.253', 44, 3, 16, 71);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (53, 45, '2023-04-27 01:46:25.569', 45, 1, 54, 74);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (24, 46, '2023-04-27 17:15:54.671', 46, 2, 62, 20);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (4, 47, '2023-04-26 22:12:14.643', 47, 5, 73, 62);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (43, 48, '2023-04-27 04:42:47.830', 48, 2, 77, 24);
insert into "course_reviews" ("course_id", "course_member_id", "created_at", "id", "rating", "spent_minutes", "user_id") values (24, 49, '2023-04-27 05:00:14.720', 49, 5, 98, 28)
1 change: 1 addition & 0 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CREATE TABLE course_reviews (
id bigint PRIMARY KEY,
course_member_id bigint REFERENCES course_members(id) NOT NULL,
course_id bigint REFERENCES courses(id) NOT NULL,
user_id bigint REFERENCES users(id) NOT NULL,
spent_minutes int NOT NULL,
rating int,
created_at timestamp
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const buildCourseReview = ({ id, courseMember, course }) => ({
id,
course_member_id: courseMember.id,
course_id: course.id,
user_id: courseMember.user_id,
spent_minutes: faker.datatype.number({ min: 1, max: 100 }),
rating: _.sample([1, 2, 3, 4, 5]),
created_at: faker.date.recent(),
Expand Down

0 comments on commit 94f54e5

Please sign in to comment.