\i mailing-lists-package-drop.sql

drop table ml_country_codes;
drop table ml_country_category_tree;
drop table ml_category_trees_visible;
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');


select acs_object_type__drop_type('mailing_list','f');
select acs_object_type__drop_type('mail_class','f');
select acs_object_type__drop_type('mail_job','f');

select acs_sc_binding__delete(
       'AcsObject',
       'mailing_list_idhandler'
);
select acs_sc_impl__delete('AcsObject', 'mailing_list_idhandler');


select acs_sc_binding__delete(
       'AcsObject',
       'mail_class_idhandler'
);
select acs_sc_impl__delete('AcsObject', 'mail_class_idhandler');


select acs_sc_binding__delete(
       'AcsObject',
       'mail_job_idhandler'
);
select acs_sc_impl__delete('AcsObject', 'mail_job_idhandler');
