Last active
July 17, 2018 17:27
-
-
Save ndarilek/ac90452bda84e038a8012efe0b019c84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
create function app.user_email_verified(u app.user) returns boolean as $$ | |
declare | |
c integer; | |
begin | |
select into c count(user_id) from app_private.email_verification_token where user_id = u.id; | |
if c = 0 then | |
return true; | |
else | |
return false; | |
end if | |
end | |
$$ language sql stable security definer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment