23 lines
629 B
MySQL
23 lines
629 B
MySQL
|
-- Deploy camper:remove_surroundings_ad to pg
|
||
|
-- requires: roles
|
||
|
-- requires: schema_camper
|
||
|
-- requires: surroundings_ad
|
||
|
-- requires: surroundings_ad_i18n
|
||
|
|
||
|
begin;
|
||
|
|
||
|
set search_path to camper, public;
|
||
|
|
||
|
create or replace function remove_surroundings_ad(company_id integer) returns void as
|
||
|
$$
|
||
|
delete from surroundings_ad_i18n where company_id = remove_surroundings_ad.company_id;
|
||
|
delete from surroundings_ad where company_id = remove_surroundings_ad.company_id;
|
||
|
$$
|
||
|
language sql
|
||
|
;
|
||
|
|
||
|
revoke execute on function remove_surroundings_ad(integer) from public;
|
||
|
grant execute on function remove_surroundings_ad(integer) to admin;
|
||
|
|
||
|
commit;
|