feature #4: create function for follow

This commit is contained in:
2019-07-28 23:24:31 +02:00
parent 4407a39482
commit 97900fba15
4 changed files with 98 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
create or replace function unfollow(reference regclass, target_id uuid, citizen_id uuid) returns void
language plpgsql as
$$
declare
_citizen_id alias for citizen_id;
_target_id alias for target_id;
begin
delete
from follow f
where f.citizen_id = _citizen_id
and f.target_id = _target_id
and f.target_reference = reference;
end;
$$;
-- drop function if exists unfollow(regclass, uuid, uuid);