numerus/deploy/tag_contact.sql

23 lines
650 B
PL/PgSQL

-- Deploy numerus:tag_contact to pg
-- requires: schema_numerus
-- requires: tag_name
-- requires: tag_relation
-- requires: contact_tag
begin;
set search_path to numerus, public;
create or replace function tag_contact (company_id integer, contact_id integer, tags tag_name[]) returns void as
$$
select tag_relation('contact_tag', 'contact_id', company_id, contact_id, tags);
$$
language sql
;
revoke execute on function tag_contact(integer, integer, tag_name[]) from public;
grant execute on function tag_contact(integer, integer, tag_name[]) to invoicer;
grant execute on function tag_contact(integer, integer, tag_name[]) to admin;
commit;