-
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.
Merge pull request #169 from novaforgood/Max/block
Various fixes
- Loading branch information
Showing
24 changed files
with
1,657 additions
and
32 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
hasura/migrations/mentorcenter/1684187688275_modify_profile_blocked_by_user_func/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,16 @@ | ||
-- Could not auto-generate a down migration. | ||
-- Please write an appropriate down migration for the SQL below: | ||
-- CREATE OR REPLACE FUNCTION public.profile_blocked_by_user(profile_row profile, hasura_session json) | ||
-- RETURNS boolean | ||
-- LANGUAGE sql | ||
-- STABLE | ||
-- AS $function$ | ||
-- SELECT EXISTS ( | ||
-- SELECT 1 | ||
-- FROM block | ||
-- JOIN profile ON block.blocker_profile_id = profile.id | ||
-- WHERE block.blocker_profile_id = profile.id | ||
-- AND block.blocked_profile_id = profile.id | ||
-- AND profile.user_id = hasura_session ->> 'x-hasura-user-id' | ||
-- ); | ||
-- $function$; |
14 changes: 14 additions & 0 deletions
14
hasura/migrations/mentorcenter/1684187688275_modify_profile_blocked_by_user_func/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,14 @@ | ||
CREATE OR REPLACE FUNCTION public.profile_blocked_by_user(profile_row profile, hasura_session json) | ||
RETURNS boolean | ||
LANGUAGE sql | ||
STABLE | ||
AS $function$ | ||
SELECT EXISTS ( | ||
SELECT 1 | ||
FROM block | ||
JOIN profile ON block.blocker_profile_id = profile.id | ||
WHERE block.blocker_profile_id = profile.id | ||
AND block.blocked_profile_id = profile.id | ||
AND profile.user_id = hasura_session ->> 'x-hasura-user-id' | ||
); | ||
$function$; |
Oops, something went wrong.