camper/deploy/add_surroundings_highlight.sql

24 lines
719 B
MySQL
Raw Normal View History

-- Deploy camper:add_surroundings_highlight to pg
-- requires: roles
-- requires: schema_camper
-- requires: surroundings_highlight
begin;
set search_path to camper, public;
create or replace function add_surroundings_highlight(company integer, media_id integer, name text, description text) returns integer as
$$
insert into surroundings_highlight (company_id, media_id, name, description)
values (company, media_id, name, xmlparse(content description))
returning surroundings_highlight_id
;
$$
language sql
;
revoke execute on function add_surroundings_highlight(integer, integer, text, text) from public;
grant execute on function add_surroundings_highlight(integer, integer, text, text) to admin;
commit;