-- Deploy camper:unset_campsite_type_pet_cost to pg
-- requires: roles
-- requires: schema_camper
-- requires: campsite_type
-- requires: campsite_type_pet_cost

begin;

set search_path to camper, public;

create or replace function unset_campsite_type_pet_cost(slug uuid) returns void as
$$
	delete from campsite_type_pet_cost
	where campsite_type_id in (
		select campsite_type_id
		from campsite_type
		where campsite_type.slug = unset_campsite_type_pet_cost.slug
	);
$$
	language sql
;

revoke execute on function unset_campsite_type_pet_cost(uuid) from public;
grant execute on function unset_campsite_type_pet_cost(uuid) to admin;

commit;
