Project

General

Profile

1
DO \$\$BEGIN
2
	DELETE FROM apicollections USING api WHERE api=api.id AND api.id=$id$ AND api.datasource=$datasource$ AND api.removable=true AND api.active=false;
3
	DELETE FROM api WHERE id=$id$ AND datasource=$datasource$ AND removable=true AND active=false;
4
	IF NOT FOUND THEN
5
		raise exception 'Api not deleted'; 
6
	END IF;
7
END\$\$;
(5-5/20)