This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO bookmark_index (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video, vid_id) VALUES ('johnny', 'Baywatch', '1', 'true', '666QAZ', '2013-12-25 15:12:51', 20, '666QAZ'); | |
INSERT INTO bookmark_index (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video, vid_id) VALUES ('johnny', 'Baywatch', '1', 'true', '', '2013-12-25 15:12:51', 20, '666QAZ'); | |
INSERT INTO bookmark_index (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video, vid_id) VALUES ('johnny', 'Baywatch', '1', '', '666QAZ', '2013-12-25 15:12:51', 20, '666QAZ'); | |
INSERT INTO bookmark_index (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video, vid_id) VALUES ('johnny', 'Baywatch', '1', '', '', '2013-12-25 15:12:51', 20, '666QAZ'); | |
INSERT INTO bookmark_index (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video, vid_id) VALUES ('johnny', 'Baywatch', '', 'true', '666QAZ', '2013-12-25 15:12:51', 20, '666QAZ'); | |
INSER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO bookmark_by_user_tvshow_and_season (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('johnny', 'Baywatch', 1, true, '666QAZ', '2013-12-25 15:12:51', 20); | |
INSERT INTO bookmark_by_user_tvshow_and_season (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('johnny', 'Knight Rider', 3, false, '666WSX', '2013-12-26 15:12:51', 30); | |
INSERT INTO bookmark_by_user_tvshow_and_season (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('patrick', 'A-Team', 5, true, '666EDC', '2013-12-27 15:12:51', 40); | |
INSERT INTO bookmark_by_user_tvshow_and_season (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('hayato', 'Thundercats', 1, false, '666RFV', '2013-12-28 15:12:51', 50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE bookmark_by_user_continue_watching ( | |
user_id text, | |
tvshow_id text, | |
season int, | |
continue_watching boolean, | |
video_id text, | |
created timestamp, | |
time_in_video int, | |
PRIMARY KEY ((user_id, continue_watching), video_id) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO bookmark_by_user_video (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('johnny', 'Baywatch', 1, true, '666QAZ', '2013-12-25 15:12:51', 20); | |
INSERT INTO bookmark_by_user_video (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('johnny', 'Knight Rider', 3, false, '666WSX', '2013-12-26 15:12:51', 30); | |
INSERT INTO bookmark_by_user_video (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('patrick', 'A-Team', 5, true, '666EDC', '2013-12-27 15:12:51', 40); | |
INSERT INTO bookmark_by_user_video (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('hayato', 'Thundercats', 1, false, '666RFV', '2013-12-28 15:12:51', 50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE bookmark_index ( | |
user_id text, | |
tvshow_id text, | |
season text, | |
continue_watching text, | |
video_id text, | |
created timestamp, | |
time_in_video int, | |
vid_id text, | |
PRIMARY KEY ((user_id, tvshow_id, season, continue_watching, video_id)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT video_id, created, time_in_video FROM bookmark_by_user_tvshow_and_season WHERE user_id = 'johnny' AND tvshow_id = 'Baywatch' AND season = 1 ; | |
video_id | created | time_in_video | |
----------+--------------------------+--------------- | |
666QAZ | 2013-12-25 15:12:51+0100 | 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE bookmark_by_user_tvshow_and_season ( | |
user_id text, | |
tvshow_id text, | |
season int, | |
continue_watching boolean, | |
video_id text, | |
created timestamp, | |
time_in_video int, | |
PRIMARY KEY ((user_id, tvshow_id, season), video_id) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT video_id, created, time_in_video FROM bookmark_by_user_continue_watching WHERE user_id = 'johnny' and continue_watching = true ; | |
video_id | created | time_in_video | |
----------+--------------------------+--------------- | |
666QAZ | 2013-12-25 15:12:51+0100 | 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO bookmark_by_user_continue_watching (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('johnny', 'Baywatch', 1, true, '666QAZ', '2013-12-25 15:12:51', 20); | |
INSERT INTO bookmark_by_user_continue_watching (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('johnny', 'Knight Rider', 3, false, '666WSX', '2013-12-26 15:12:51', 30); | |
INSERT INTO bookmark_by_user_continue_watching (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('patrick', 'A-Team', 5, true, '666EDC', '2013-12-27 15:12:51', 40); | |
INSERT INTO bookmark_by_user_continue_watching (user_id, tvshow_id, season, continue_watching, video_id, created, time_in_video) VALUES ('hayato', 'Thundercats', 1, false, '666RFV', '2013-12-28 15:12:51', 50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM bookmark_by_user_video ; | |
user_id | video_id | continue_watching | created | season | time_in_video | tvshow_id | |
---------+----------+-------------------+--------------------------+--------+---------------+-------------- | |
patrick | 666EDC | True | 2013-12-27 15:12:51+0100 | 5 | 40 | A-Team | |
johnny | 666QAZ | True | 2013-12-25 15:12:51+0100 | 1 | 20 | Baywatch | |
johnny | 666WSX | False | 2013-12-26 15:12:51+0100 | 3 | 30 | Knight Rider | |
hayato | 666RFV | False | 2013-12-28 15:12:51+0100 | 1 | 50 | Thundercats |