-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathuninstall.sql
62 lines (55 loc) · 3.2 KB
/
uninstall.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
prompt uninstall.sql
-- v0.6
prompt drop job (process queue)
begin dbms_scheduler.stop_job ('mailgun_process_queue'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
begin dbms_scheduler.drop_job('mailgun_process_queue'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
prompt drop job (purge logs)
begin dbms_scheduler.stop_job ('mailgun_purge_logs'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
begin dbms_scheduler.drop_job('mailgun_purge_logs'); exception when others then if sqlcode not in (-27366,-27475) then raise; end if; end;
/
prompt drop queue
begin dbms_aqadm.stop_queue (user||'.mailgun_queue'); exception when others then if sqlcode!=-24010 then raise; end if; end;
/
begin dbms_aqadm.drop_queue (user||'.mailgun_queue'); exception when others then if sqlcode!=-24010 then raise; end if; end;
/
begin dbms_aqadm.drop_queue_table (user||'.mailgun_queue_tab'); exception when others then if sqlcode not in (-24010,-24002) then raise; end if; end;
/
prompt drop tables
begin execute immediate 'drop table mailgun_email_log'; exception when others then if sqlcode!=-942 then raise; end if; end;
/
begin execute immediate 'drop table mailgun_settings'; exception when others then if sqlcode!=-942 then raise; end if; end;
/
prompt drop types
begin execute immediate 'drop type t_mailgun_attachment_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_recipient_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_event_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_stat_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_suppression_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_tag_arr'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_email'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_attachment'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_recipient'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_event'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_stat'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_suppression'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
begin execute immediate 'drop type t_mailgun_tag'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
prompt drop package
begin execute immediate 'drop package mailgun_pkg'; exception when others then if sqlcode!=-4043 then raise; end if; end;
/
prompt finished.