19d40aa67e42b11dd7a34c869e380eda6ed20310
[mmondor.git] / mmsoftware / mmmail / scripts / upgrade-0.0.24.sql
1 # $Id: upgrade-0.0.24.sql,v 1.7 2004/11/15 23:02:03 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
19 CREATE TABLE filter (
20 filter_address varchar(64) NOT NULL default '',
21 filter_allow varchar(64) NOT NULL default '',
22 KEY filter_address (filter_address),
23 KEY filter_allow (filter_allow)
24 ) TYPE=MyISAM;
25
26 #
27 # Table structure for table 'relayqueue'
28 #
29
30 CREATE TABLE relayqueue (
31 relayqueue_id bigint(20) NOT NULL auto_increment,
32 relayqueue_from varchar(64) NOT NULL default '',
33 relayqueue_ipaddr varchar(16) NOT NULL default '0.0.0.0',
34 relayqueue_todomain varchar(64) NOT NULL default '',
35 relayqueue_touser varchar(64) NOT NULL default '',
36 relayqueue_size int(11) NOT NULL default '0',
37 relayqueue_file varchar(255) NOT NULL default '',
38 relayqueue_queued datetime NOT NULL default '0000-00-00 00:00:00',
39 relayqueue_lasttry datetime NOT NULL default '0000-00-00 00:00:00',
40 relayqueue_expire datetime NOT NULL default '0000-00-00 00:00:00',
41 relayqueue_tries int(11) NOT NULL default '0',
42 relayqueue_lasterror int(11) NOT NULL default '0',
43 PRIMARY KEY (relayqueue_id)
44 ) TYPE=MyISAM;
45
46 #
47 # Table structure for table 'relaylocal'
48 #
49
50 CREATE TABLE relaylocal (
51 relaylocal_pattern varchar(64) NOT NULL default '',
52 PRIMARY KEY (relaylocal_pattern)
53 ) TYPE=MyISAM;
54
55 #
56 # Table structure for table 'relayfrom'
57 #
58
59 CREATE TABLE relayfrom (
60 relayfrom_pattern varchar(64) NOT NULL default '',
61 PRIMARY KEY (relayfrom_pattern)
62 ) TYPE=MyISAM;