-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hasura): sort by latest chapter publish
- Loading branch information
Showing
4 changed files
with
73 additions
and
44 deletions.
There are no files selected for viewing
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
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
11 changes: 11 additions & 0 deletions
11
hasura/migrations/punkga-pg/1690364416444_create manga latest publish function/down.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- CREATE OR REPLACE FUNCTION latest_published(manga_row manga) RETURNS | ||
-- timestamp with time zone | ||
-- AS $$ | ||
-- SELECT pushlish_date | ||
-- FROM chapters | ||
-- WHERE chapters.manga_id = manga_row.id AND chapters.status = 'Published' | ||
-- ORDER BY pushlish_date DESC NULLS LAST | ||
-- LIMIT 1 | ||
-- $$ LANGUAGE sql STABLE; |
9 changes: 9 additions & 0 deletions
9
hasura/migrations/punkga-pg/1690364416444_create manga latest publish function/up.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE OR REPLACE FUNCTION latest_published(manga_row manga) RETURNS | ||
timestamp with time zone | ||
AS $$ | ||
SELECT pushlish_date | ||
FROM chapters | ||
WHERE chapters.manga_id = manga_row.id AND chapters.status = 'Published' | ||
ORDER BY pushlish_date DESC NULLS LAST | ||
LIMIT 1 | ||
$$ LANGUAGE sql STABLE; |