camper/deploy/add_page.sql

23 lines
521 B
MySQL
Raw Normal View History

-- Deploy camper:add_page to pg
-- requires: roles
-- requires: schema_camper
-- requires: page
begin;
set search_path to camper, public;
create or replace function add_page(company integer, title text, content text) returns uuid as
$$
insert into page (company_id, title, content)
values (company, title, xmlparse (content content))
returning slug;
$$
language sql
;
revoke execute on function add_page(integer, text, text) from public;
grant execute on function add_page(integer, text, text) to admin;
commit;