camper/deploy/remove_amenity_feature.sql

23 lines
599 B
MySQL
Raw Normal View History

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