camper/deploy/remove_campsite_feature.sql

23 lines
609 B
MySQL
Raw Normal View History

-- Deploy camper:remove_campsite_feature to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_feature
-- requires: campsite_feature_i18n
begin;
set search_path to camper, public;
create or replace function remove_campsite_feature(feature_id integer) returns void as
$$
delete from campsite_feature_i18n where campsite_feature_id = feature_id;
delete from campsite_feature where campsite_feature_id = feature_id;
$$
language sql
;
revoke execute on function remove_campsite_feature(integer) from public;
grant execute on function remove_campsite_feature(integer) to admin;
commit;