*** empty log message ***
[mmondor.git] / mmsoftware / mmmail / scripts / upgrade-0.0.24.sql
1 # $Id: upgrade-0.0.24.sql,v 1.10 2004/11/18 17:21:44 mmondor Exp $
2 #
3 # You should execute this script if you are upgrading mmmail from 0.0.21 or
4 # later to 0.0.24 or later. This adds the new mail_file field for those using
5 # file message body storage, and modifies the glob field to allow NULL values.
6 # It also adds the filter table for optional per-box allow filters, and
7 # introduces support for optional relaying and related security.
8 #
9
10 ALTER TABLE mail MODIFY COLUMN mail_data longtext;
11 ALTER TABLE mail ADD COLUMN mail_file varchar(255);
12 ALTER TABLE box ADD COLUMN box_filter tinyint(1) NOT NULL default '0';
13
14 ALTER TABLE user MODIFY user_id varchar(32) NOT NULL;
15 ALTER TABLE box MODIFY box_user varchar(32) NOT NULL;
16 ALTER TABLE user DROP COLUMN user_admin;
17 ALTER TABLE alias DROP COLUMN alias_user;
18 ALTER TABLE alias ADD PRIMARY KEY (alias_domain,alias_pattern,alias_box);
19
20 CREATE TABLE filter (
21 filter_address varchar(64) NOT NULL default '',
22 filter_allow varchar(64) NOT NULL default '',
23 filter_created datetime NOT NULL default '0000-00-00 00:00:00',
24 PRIMARY KEY (filter_address,filter_allow)
25 ) TYPE=MyISAM;
26
27 #
28 # Table structure for table 'relayqueue'
29 #
30
31 CREATE TABLE relayqueue (
32 relayqueue_id bigint(20) NOT NULL auto_increment,
33 relayqueue_from varchar(64) NOT NULL default '',
34 relayqueue_ipaddr varchar(16) NOT NULL default '0.0.0.0',
35 relayqueue_todomain varchar(64) NOT NULL default '',
36 relayqueue_touser varchar(64) NOT NULL default '',
37 relayqueue_size int(11) NOT NULL default '0',
38 relayqueue_file varchar(255) NOT NULL default '',
39 relayqueue_queued datetime NOT NULL default '0000-00-00 00:00:00',
40 relayqueue_lasttry datetime NOT NULL default '0000-00-00 00:00:00',
41 relayqueue_expire datetime NOT NULL default '0000-00-00 00:00:00',
42 relayqueue_tries int(11) NOT NULL default '0',
43 relayqueue_lasterror int(11) NOT NULL default '0',
44 PRIMARY KEY (relayqueue_id)
45 ) TYPE=MyISAM;
46
47 #
48 # Table structure for table 'relaylocal'
49 #
50
51 CREATE TABLE relaylocal (
52 relaylocal_pattern varchar(64) NOT NULL default '',
53 PRIMARY KEY (relaylocal_pattern)
54 ) TYPE=MyISAM;
55
56 #
57 # Table structure for table 'relayfrom'
58 #
59
60 CREATE TABLE relayfrom (
61 relayfrom_pattern varchar(64) NOT NULL default '',
62 PRIMARY KEY (relayfrom_pattern)
63 ) TYPE=MyISAM;
64
65 #
66 # Table structure for table 'session'
67 #
68
69 CREATE TABLE session (
70 session_id varchar(64) binary NOT NULL default '',
71 session_expires int(11) NOT NULL default '0',
72 session_data text NOT NULL,
73 PRIMARY KEY (session_id)
74 ) TYPE=MyISAM;