drop package ml_mailing_list;
drop package ml_mail_class;
drop package ml_mail_job;

drop table ml_bounce_log;
drop table ml_user_email_log;
drop table ml_email_log;
drop table ml_mail_job_bind_vars;
drop table ml_mail_jobs;
drop table ml_mail_classes;
drop table ml_mailing_list_user_map;
drop table ml_mailing_lists;

delete from acs_objects where object_type='mailing_list';
delete from acs_objects where object_type='mail_class';
delete from acs_objects where object_type='mail_job';

delete from acs_permissions
where privilege in ('mailing_list_admin');

delete from acs_privilege_hierarchy
where privilege in ('mailing_list_admin');

delete from acs_privilege_hierarchy
where child_privilege in ('mailing_list_admin');

delete from acs_privileges
where privilege in ('mailing_list_admin');

begin
   acs_object_type.drop_type('mailing_list');
   acs_object_type.drop_type('mail_class');
   acs_object_type.drop_type('mail_job');

   acs_sc_binding.delete(
           contract_name => 'AcsObject',
	   impl_name => 'mailing_list_idhandler'
   );
   acs_sc_impl.delete('AcsObject', 'mailing_list_idhandler');
   acs_sc_binding.delete(
           contract_name => 'AcsObject',
	   impl_name => 'mail_class_idhandler'
   );
   acs_sc_impl.delete('AcsObject', 'mail_class_idhandler');
   acs_sc_binding.delete(
           contract_name => 'AcsObject',
	   impl_name => 'mail_job_idhandler'
   );
   acs_sc_impl.delete('AcsObject', 'mail_job_idhandler');
end;
/
show errors
