--
-- apm_application__delete/1
--
create or replace function apm_application__delete(
  integer
) returns int4 as $$

declare
  delete__application_id         alias for $1;  
begin
    delete from apm_applications
    where application_id = delete__application_id;
    PERFORM apm_package__delete(
        delete__application_id
    );

    return 0; 
end;$$ language plpgsql;