root/trunk/sql_upgrades

Revision 224, 8.5 kB (checked in by jonas, 13 months ago)
Line 
1Version 0.01 to 0.02:
2ALTER TABLE `domains` ADD `spamassassin` TINYINT(1) DEFAULT '1' NOT NULL;
3
4Version 0.02 to 0.03
5ALTER TABLE `domains` CHANGE `disableimap` `p_imap` TINYINT( 1 ) NULL DEFAULT '1';
6ALTER TABLE `domains` CHANGE `disablepop3` `p_pop3` TINYINT( 1 ) NULL DEFAULT '1';
7ALTER TABLE `domains` CHANGE `disablewebmail` `p_webmail` TINYINT( 1 ) NULL DEFAULT '1';
8ALTER TABLE `domains` CHANGE `spamassassin` `p_spamassassin` TINYINT( 1 ) NULL DEFAULT '1';
9
10ALTER TABLE `users` CHANGE `disableimap` `p_imap` TINYINT( 1 ) NULL DEFAULT '1';
11ALTER TABLE `users` CHANGE `disablepop3` `p_pop3` TINYINT( 1 ) NULL DEFAULT '1';
12ALTER TABLE `users` CHANGE `disablewebmail` `p_webmail` TINYINT( 1 ) NULL DEFAULT '1';
13ALTER TABLE `users` CHANGE `spamassassin` `p_spamassassin` TINYINT( 1 ) NULL DEFAULT '1';
14ALTER TABLE `users` ADD `p_forwarding` TINYINT( 1 ) NULL DEFAULT '1';
15
16CREATE TABLE `autoresponder_recipient` (
17  `id` int(11) NOT NULL auto_increment,
18  `email` int(11) NOT NULL default '0',
19  `recip` varchar(250) NOT NULL default '',
20  PRIMARY KEY  (`id`),
21  KEY `email` (`email`)
22) ENGINE=MyISAM DEFAULT CHARSET=utf8;
23
24ALTER TABLE `domains` ADD `p_mailarchive` TINYINT( 1 ) DEFAULT '0';
25ALTER TABLE `users` ADD `p_mailarchive` TINYINT( 1 ) DEFAULT '0';
26
27ALTER TABLE `domains` ADD `p_bogofilter` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
28ALTER TABLE `users` ADD `p_bogofilter` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
29
30CREATE TABLE `autoresponder_disable` (
31  `id` int(11) NOT NULL auto_increment,
32  `email` int(11) NOT NULL default '0',
33  `active` tinyint(1) NOT NULL default '1',
34  `a_date` timestamp NOT NULL default CURRENT_TIMESTAMP,
35  PRIMARY KEY  (`id`),
36  KEY `email` (`email`)
37) ENGINE=MyISAM DEFAULT CHARSET=utf8;
38
39CREATE TABLE `sa_wb_listing` (
40  `id` int(11) NOT NULL auto_increment,
41  `domainid` int(11) NOT NULL default '0',
42  `email` int(11) NOT NULL default '0',
43  `sa_from` varchar(250) NOT NULL default '',
44  `type` tinyint(1) NOT NULL default '1',
45  PRIMARY KEY  (`id`),
46  KEY `domainid` (`domainid`),
47  KEY `type` (`type`)
48) ENGINE=MyISAM DEFAULT CHARSET=utf8;
49
50ALTER TABLE `domains` ADD `p_sa_wb_listing` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
51
52
53Version 0.03 to 0.04
54ALTER TABLE `domains` ADD `p_mailfilter` TINYINT( 1 ) NOT NULL DEFAULT '0';
55ALTER TABLE `domains` ADD `p_spam_del` TINYINT( 1 ) NOT NULL DEFAULT '0';
56ALTER TABLE `users` ADD `p_spam_del` TINYINT( 1 ) NOT NULL DEFAULT '0';
57CREATE TABLE `mailarchive` (
58`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
59`email` INT NOT NULL ,
60`folder` VARCHAR( 250 ) NOT NULL ,
61`adays` INT NOT NULL ,
62`fname_month` TINYINT( 1 ) NOT NULL ,
63`fname_year` TINYINT( 1 ) NOT NULL ,
64`active` TINYINT( 1 ) NOT NULL ,
65INDEX ( `email` , `active` )
66) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
67ALTER TABLE `mailarchive` ADD `mailsread` TINYINT( 1 ) NOT NULL ;
68ALTER TABLE `autoresponder` ADD `times` CHAR( 1 ) NOT NULL DEFAULT '1';
69ALTER TABLE `domains` ADD `enew` TINYINT( 1 ) NOT NULL DEFAULT '1';
70
71ALTER TABLE `domains` ADD `p_sa_learn` TINYINT( 1 ) NOT NULL DEFAULT '0';
72ALTER TABLE `users` ADD `p_sa_learn` TINYINT( 1 ) NOT NULL DEFAULT '0';
73
74CREATE TABLE `spamassassin_learn` (
75`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
76`email` INT NOT NULL ,
77`folder` VARCHAR( 255 ) NOT NULL ,
78`active` TINYINT( 1 ) NOT NULL DEFAULT '0',
79`type` ENUM( 'spam', 'ham' ) NOT NULL
80) ENGINE = MYISAM ;
81ALTER TABLE `domains` ADD `p_fetchmail` TINYINT( 1 ) NOT NULL DEFAULT '0';
82ALTER TABLE `users` ADD `p_fetchmail` TINYINT( 1 ) NOT NULL DEFAULT '0';
83CREATE TABLE `fetchmail` (
84  `id` int(11) NOT NULL auto_increment,
85  `email` int(11) NOT NULL default '0',
86  `server` varchar(255) NOT NULL default '',
87  `proto` tinyint(1) NOT NULL default '0',
88  `conn_type` tinyint(1) NOT NULL default '0',
89  `username` varchar(255) NOT NULL default '',
90  `password` varchar(255) NOT NULL default '',
91  `keep_mails` tinyint(1) NOT NULL default '0',
92  `active` tinyint(1) NOT NULL default '1',
93  PRIMARY KEY  (`id`),
94  KEY `email` (`email`),
95  KEY `active` (`active`)
96) ENGINE=MyISAM DEFAULT CHARSET=utf8;
97ALTER TABLE `adm_users` CHANGE `access` `access` VARCHAR( 2 ) NOT NULL DEFAULT 'y';
98update adm_users SET access='1' WHERE access='y';
99update adm_users SET access='0' WHERE access='n';
100ALTER TABLE `adm_users` CHANGE `access` `access` TINYINT( 1 ) NOT NULL DEFAULT '1';
101ALTER TABLE `adm_users` CHANGE `manager` `manager` VARCHAR( 2 ) NOT NULL DEFAULT 'y';
102update adm_users SET manager='1' WHERE manager='y';
103update adm_users SET manager='0' WHERE manager='n';
104ALTER TABLE `adm_users` CHANGE `manager` `manager` TINYINT( 1 ) NOT NULL DEFAULT '0';
105ALTER TABLE `users` DROP `admin` ;
106ALTER TABLE `users` CHANGE `access` `access` VARCHAR( 2 ) NOT NULL DEFAULT 'y';
107update users SET access='1' WHERE access='y';
108update users SET access='0' WHERE access='n';
109ALTER TABLE `users` CHANGE `access` `access` TINYINT( 1 ) NOT NULL DEFAULT '1';
110ALTER TABLE `domains` CHANGE `access` `access` VARCHAR( 2 ) NOT NULL DEFAULT 'y';
111update domains SET access='1' WHERE access='y';
112update domains SET access='0' WHERE access='n';
113ALTER TABLE `domains` CHANGE `access` `access` TINYINT( 1 ) NOT NULL DEFAULT '1';
114ALTER TABLE `forwardings` CHANGE `access` `access` VARCHAR( 2 ) NOT NULL DEFAULT 'y';
115update forwardings SET access='1' WHERE access='y';
116update forwardings SET access='0' WHERE access='n';
117ALTER TABLE `forwardings` CHANGE `access` `access` TINYINT( 1 ) NOT NULL DEFAULT '1';
118ALTER TABLE `spamassassin` ADD `email` INT NOT NULL FIRST;
119ALTER TABLE `domains` ADD `p_webinterface` TINYINT( 1 ) DEFAULT '1' NOT NULL;
120ALTER TABLE `users` ADD `p_webinterface` TINYINT( 1 ) DEFAULT '1' NOT NULL;
121
122
123Version 0.04 to 0.05
124ALTER TABLE `lists` modify column `access` TINYINT( 1 ) DEFAULT '1' NOT NULL;
125
126Version 0.05 to 0.06
127CREATE TABLE `autoresponder_xheader` (
128  `id` int(11) NOT NULL auto_increment,
129  `email` int(11) NOT NULL,
130  `xheader` varchar(255) NOT NULL,
131  `value` varchar(255) NOT NULL,
132  PRIMARY KEY  (`id`),
133  KEY `email` (`email`)
134) ENGINE=MyISAM DEFAULT CHARSET=utf8;
135ALTER TABLE `domains` ADD `p_autores_xheader` TINYINT( 1 ) NOT NULL DEFAULT '0';
136ALTER TABLE `users` ADD `p_autores_xheader` TINYINT( 1 ) NOT NULL DEFAULT '0';
137ALTER TABLE `users` ADD `mb_size` INT NOT NULL DEFAULT '0';
138ALTER TABLE `adm_users` ADD `web_lang` VARCHAR( 8 ) NOT NULL ;
139
140Version 0.07 to 0.08
141ALTER TABLE `users` ADD `p_check_polw` TINYINT( 1 ) DEFAULT '1' NOT NULL ;
142ALTER TABLE `users` ADD `p_check_grey` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
143
144ALTER TABLE `forwardings` ADD `p_check_polw` TINYINT( 1 ) DEFAULT '1' NOT NULL ;
145ALTER TABLE `forwardings` ADD `p_check_grey` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
146
147ALTER TABLE `domains` ADD `p_check_polw` TINYINT( 1 ) DEFAULT '1' NOT NULL ;
148ALTER TABLE `domains` ADD `p_check_grey` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
149
150DROP VIEW IF EXISTS smtpd_recipient_classes;
151CREATE VIEW smtpd_recipient_classes AS  SELECT email,if(p_check_polw=1,'check_polw','') AS polw,if(p_check_grey=1,'check_grey','') AS grey FROM users WHERE access=1 AND p_check_polw!=0 AND p_check_polw!=0 UNION SELECT efrom,if(p_check_polw=1,'check_polw','') AS polw,if(p_check_grey=1,'check_grey','') AS grey FROM forwardings WHERE access=1 AND p_check_polw!=0 AND p_check_polw!=0;
152
153CREATE TABLE `lists` (
154  `id` int(11) NOT NULL auto_increment,
155  `domainid` int(11) NOT NULL,
156  `address` varchar(80) NOT NULL,
157  `access` tinyint(1) default '1',
158  `public` enum('y','n') NOT NULL,
159  PRIMARY KEY  (`id`),
160  KEY `second` (`address`,`access`)
161) ENGINE=MyISAM DEFAULT CHARSET=utf8;
162
163CREATE TABLE `list_recp` (
164  `id` int(11) NOT NULL auto_increment,
165  `recp` varchar(100) default NULL,
166  KEY `listID` (`id`)
167) ENGINE=MyISAM DEFAULT CHARSET=utf8;
168
169ALTER TABLE `domains` ADD `p_mlists` TINYINT NOT NULL DEFAULT '0';
170
171
172Version 0.09 to 0.10
173ALTER TABLE `domains` ADD `p_spam_fwd` TINYINT( 1 ) NOT NULL DEFAULT '0';
174ALTER TABLE `users` ADD `p_spam_fwd` TINYINT( 1 ) NOT NULL DEFAULT '0';
175ALTER TABLE `adm_users` CHANGE `web_lang` `web_lang` VARCHAR( 14 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
176
177Version 0.10 to 0.11
178DROP VIEW IF EXISTS smtpd_recipient_classes;
179CREATE VIEW smtpd_recipient_classes AS  SELECT email,if(p_check_polw=1,'check_polw','') AS polw,if(p_check_grey=1,'check_grey','') AS grey FROM users WHERE access=1 AND p_check_polw!=0 AND p_check_polw!=0 UNION SELECT efrom,if(p_check_polw=1,'check_polw','') AS polw,if(p_check_grey=1,'check_grey','') AS grey FROM forwardings WHERE access=1 AND p_check_polw!=0 AND p_check_polw!=0 AND efrom NOT REGEXP '^@';
180
181CREATE TABLE `domains_forward` (
182`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
183`fr_domain` INT NOT NULL ,
184`to_domain` INT NOT NULL ,
185INDEX ( `fr_domain` )
186) ENGINE = MYISAM ;
187ALTER TABLE `domains` ADD `p_autores` TINYINT( 1 ) NOT NULL DEFAULT '1';
188
Note: See TracBrowser for help on using the browser.