fix(scheduled_shows.sql): sort upcoming shows by air date ascending
This commit is contained in:
parent
970061ff9d
commit
ca57082f01
3 changed files with 9 additions and 4 deletions
|
@ -196,7 +196,12 @@ SELECT json_build_object(
|
|||
FROM episodes e
|
||||
WHERE e.show = s.id
|
||||
)
|
||||
ORDER BY s.title ASC
|
||||
ORDER BY (
|
||||
SELECT MIN(se.air_date)
|
||||
FROM scheduled_episodes se
|
||||
WHERE se.show_id = s.id
|
||||
AND se.status IN ('upcoming', 'aired')
|
||||
) ASC NULLS LAST
|
||||
) unstarted
|
||||
)
|
||||
) AS scheduled_shows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue