diff options
| author | ckonstanski <carlos.konstanski@olo.com> | 2024-05-25 18:03:25 -0600 |
|---|---|---|
| committer | ckonstanski <carlos.konstanski@olo.com> | 2024-05-25 18:03:25 -0600 |
| commit | b8423f4d05c75094b7b9d09c6f0bb353acc9be1c (patch) | |
| tree | 3732f71f84191b26f038130c2220fb502d738251 /sql/functions/auth.update_profile.sql | |
initial commit
Diffstat (limited to 'sql/functions/auth.update_profile.sql')
| -rw-r--r-- | sql/functions/auth.update_profile.sql | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/functions/auth.update_profile.sql b/sql/functions/auth.update_profile.sql new file mode 100644 index 0000000..8e08c4b --- /dev/null +++ b/sql/functions/auth.update_profile.sql @@ -0,0 +1,32 @@ +drop function auth.update_profile ( + p_id bigint, + p_username character varying, + p_first_name character varying, + p_last_name character varying, + p_email character varying, + p_phone character varying +); + +create or replace function auth.update_profile ( + p_id bigint, + p_username character varying, + p_first_name character varying, + p_last_name character varying, + p_email character varying, + p_phone character varying +) +returns bigint +as $$ +begin + update auth.users + set username = p_username, + pwd = p_pwd, + first_name = p_first_name, + last_name = p_last_name, + email = p_email, + phone = p_phone + where id = p_id; + + return p_id; +end; +$$ language plpgsql; |
