kbanta11
03/31/2022, 12:32 AMgaryaustin
03/31/2022, 12:46 AMkbanta11
03/31/2022, 1:22 AMgaryaustin
03/31/2022, 1:25 AMgaryaustin
03/31/2022, 1:26 AMkbanta11
03/31/2022, 1:27 AMkbanta11
03/31/2022, 1:27 AMkbanta11
03/31/2022, 1:28 AMgaryaustin
03/31/2022, 1:28 AMkbanta11
03/31/2022, 1:39 AMkbanta11
03/31/2022, 1:39 AMkbanta11
03/31/2022, 2:15 AMgaryaustin
03/31/2022, 2:22 AMkbanta11
03/31/2022, 2:23 AMsecurity definer
)garyaustin
03/31/2022, 2:25 AMkbanta11
03/31/2022, 2:36 AMkbanta11
03/31/2022, 2:36 AMkbanta11
03/31/2022, 2:41 AMkbanta11
03/31/2022, 2:41 AMgaryaustin
03/31/2022, 2:45 AMkbanta11
03/31/2022, 4:13 PMfunction_logs
in the logs query editor and postrges_logs doesn't seem to have them eitherkbanta11
03/31/2022, 4:13 PMgaryaustin
03/31/2022, 4:26 PMkbanta11
03/31/2022, 5:51 PMcreate or replace function public.activate_confirmed_user()
returns trigger as $$
begin
if (old.confirmed_at != new.confirmed_at) then
--update user to active
update public.users u
set activated = true
where u.id = new.id;
--update user tryggers to active
update public.tryggers
set active = true
where user_id = new.id;
commit;
end if;
return new;
end;
$$ language plpgsql security definer;
create trigger on_auth_user_confirmed
after update on auth.users
for each row execute procedure public.activate_confirmed_user();
kbanta11
03/31/2022, 5:52 PMkbanta11
03/31/2022, 5:52 PMgaryaustin
03/31/2022, 7:26 PMraise log 'I am here'
to see if you get in if, or at beginning to see function run.tourdownunder
04/01/2022, 4:39 AMold.confirmed_at
null?
If so a hint to use is distinct from
instead to compare
sql
select null != 'new confirmed at', null is distinct from 'new confirmed at'