-- Deploy camper:edit_campsite_feature to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_feature

begin;

set search_path to camper, public;

create or replace function edit_campsite_feature(feature_id integer, icon_name text, name text) returns integer as
$$
	update campsite_feature
	set icon_name = edit_campsite_feature.icon_name
	  , name = edit_campsite_feature.name
	where campsite_feature_id = feature_id
	returning campsite_feature_id
	;
$$
	language sql
;

revoke execute on function edit_campsite_feature(integer, text, text) from public;
grant execute on function edit_campsite_feature(integer, text, text) to admin;

commit;
