-
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): add total creator subscribers
- Loading branch information
Showing
4 changed files
with
45 additions
and
18 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
9 changes: 9 additions & 0 deletions
9
hasura/migrations/punkga-pg/1691132025036_calculate total_creator_subscribers /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,9 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- CREATE OR REPLACE FUNCTION total_creator_subscribers(creator_row creators) RETURNS | ||
-- int | ||
-- AS $$ | ||
-- SELECT COUNT(1) as total_subscribers FROM public.subscribers | ||
-- INNER JOIN manga_creator mc on subscribers.manga_id = mc.manga_id | ||
-- WHERE mc.creator_id = creator_row.id | ||
-- $$ LANGUAGE sql STABLE; |
7 changes: 7 additions & 0 deletions
7
hasura/migrations/punkga-pg/1691132025036_calculate total_creator_subscribers /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,7 @@ | ||
CREATE OR REPLACE FUNCTION total_creator_subscribers(creator_row creators) RETURNS | ||
int | ||
AS $$ | ||
SELECT COUNT(1) as total_subscribers FROM public.subscribers | ||
INNER JOIN manga_creator mc on subscribers.manga_id = mc.manga_id | ||
WHERE mc.creator_id = creator_row.id | ||
$$ LANGUAGE sql STABLE; |