All checks were successful
continuous-integration/drone/push Build is passing
The old behaviour was a simple join, if there's no rating for the movie, there's no result for movie. The backend can not return the movie and does a new GetDetails from online detailers.
20 lines
532 B
SQL
20 lines
532 B
SQL
CREATE OR REPLACE VIEW movies_with_rating AS
|
|
SELECT
|
|
m.id, m.imdb_id, m.title, m.plot, m.tmdb_id, m.year, m.original_title, m.runtime, m.sort_title, m.tagline, m.genres,
|
|
r.rating,
|
|
r.votes,
|
|
m.updated_at, m.created_at
|
|
FROM movies m
|
|
JOIN imdb_ratings r
|
|
ON m.imdb_id = r.imdb_id;
|
|
|
|
CREATE OR REPLACE VIEW shows_with_rating AS
|
|
SELECT
|
|
s.id, s.imdb_id, s.title, s.plot, s.tvdb_id, s.year, s.first_aired,
|
|
r.rating,
|
|
r.votes,
|
|
s.updated_at, s.created_at
|
|
FROM shows s
|
|
JOIN imdb_ratings r
|
|
ON s.imdb_id = r.imdb_id;
|