-- Deploy camper:remove_campsite_type_option to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type_option
-- requires: campsite_type_option_i18n
-- requires: campsite_type_option_cost

begin;

set search_path to camper, public;

create or replace function remove_campsite_type_option(option_id integer) returns void as
$$
	delete from campsite_type_option_cost where campsite_type_option_id = option_id;
	delete from campsite_type_option_i18n where campsite_type_option_id = option_id;
	delete from campsite_type_option where campsite_type_option_id = option_id;
$$
	language sql
;

revoke execute on function remove_campsite_type_option(integer) from public;
grant execute on function remove_campsite_type_option(integer) to admin;

commit;
