camper/deploy/edit_amenity_feature.sql

26 lines
652 B
MySQL
Raw Normal View History

-- Deploy camper:edit_amenity_feature to pg
-- requires: roles
-- requires: schema_camper
-- requires: amenity_feature
begin;
set search_path to camper, public;
create or replace function edit_amenity_feature(feature_id integer, icon_name text, name text) returns integer as
$$
update amenity_feature
set icon_name = edit_amenity_feature.icon_name
, name = edit_amenity_feature.name
where amenity_feature_id = feature_id
returning amenity_feature_id
;
$$
language sql
;
revoke execute on function edit_amenity_feature(integer, text, text) from public;
grant execute on function edit_amenity_feature(integer, text, text) to admin;
commit;