Optimize database schema; get rid of unnecessary indexes
parent
0ce1a65149
commit
ac26b96466
@ -1,51 +0,0 @@
|
|||||||
-- RoundCube Webmail update script for MySQL databases
|
|
||||||
-- Updates from version 0.1-20051007
|
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE `session` ADD `ip` VARCHAR(40) NOT NULL AFTER changed;
|
|
||||||
ALTER TABLE `users` ADD `alias` VARCHAR(128) NOT NULL AFTER mail_host;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- RoundCube Webmail update script for MySQL databases
|
|
||||||
-- Updates from version 0.1-20051021
|
|
||||||
|
|
||||||
ALTER TABLE `session` CHANGE `sess_id` `sess_id` VARCHAR(40) NOT NULL;
|
|
||||||
|
|
||||||
ALTER TABLE `contacts` CHANGE `del` `del` TINYINT(1) NOT NULL;
|
|
||||||
ALTER TABLE `contacts` ADD `changed` DATETIME NOT NULL AFTER `user_id`;
|
|
||||||
|
|
||||||
UPDATE `contacts` SET `del`=0 WHERE `del`=1;
|
|
||||||
UPDATE `contacts` SET `del`=1 WHERE `del`=2;
|
|
||||||
|
|
||||||
ALTER TABLE `identities` CHANGE `default` `standard` TINYINT(1) NOT NULL;
|
|
||||||
ALTER TABLE `identities` CHANGE `del` `del` TINYINT(1) NOT NULL;
|
|
||||||
|
|
||||||
UPDATE `identities` SET `del`=0 WHERE `del`=1;
|
|
||||||
UPDATE `identities` SET `del`=1 WHERE `del`=2;
|
|
||||||
UPDATE `identities` SET `standard`=0 WHERE `standard`=1;
|
|
||||||
UPDATE `identities` SET `standard`=1 WHERE `standard`=2;
|
|
||||||
|
|
||||||
CREATE TABLE `messages` (
|
|
||||||
`message_id` int(11) unsigned NOT NULL auto_increment,
|
|
||||||
`user_id` int(11) unsigned NOT NULL default '0',
|
|
||||||
`del` tinyint(1) NOT NULL default '0',
|
|
||||||
`cache_key` varchar(128) NOT NULL default '',
|
|
||||||
`created` datetime NOT NULL default '0000-00-00 00:00:00',
|
|
||||||
`idx` int(11) unsigned NOT NULL default '0',
|
|
||||||
`uid` int(11) unsigned NOT NULL default '0',
|
|
||||||
`subject` varchar(255) NOT NULL default '',
|
|
||||||
`from` varchar(255) NOT NULL default '',
|
|
||||||
`to` varchar(255) NOT NULL default '',
|
|
||||||
`cc` varchar(255) NOT NULL default '',
|
|
||||||
`date` datetime NOT NULL default '0000-00-00 00:00:00',
|
|
||||||
`size` int(11) unsigned NOT NULL default '0',
|
|
||||||
`headers` text NOT NULL,
|
|
||||||
`structure` text,
|
|
||||||
PRIMARY KEY (`message_id`),
|
|
||||||
KEY `user_id` (`user_id`),
|
|
||||||
KEY `idx` (`idx`),
|
|
||||||
KEY `uid` (`uid`),
|
|
||||||
UNIQUE `uniqueness` (`cache_key`, `uid`)
|
|
||||||
) TYPE=MyISAM;
|
|
||||||
|
|
@ -1,21 +1,13 @@
|
|||||||
-- RoundCube Webmail update script for MySQL databases
|
-- RoundCube Webmail update script for MySQL databases
|
||||||
-- Updates from version 0.1-beta and 0.1-beta2
|
-- Updates from version 0.1-stable to 0.1.1
|
||||||
|
|
||||||
TRUNCATE TABLE `messages`;
|
TRUNCATE TABLE `messages`;
|
||||||
|
|
||||||
ALTER TABLE `messages`
|
ALTER TABLE `messages`
|
||||||
DROP `body`,
|
DROP INDEX `idx`,
|
||||||
DROP INDEX `cache_key`,
|
DROP INDEX `uid`;
|
||||||
ADD `structure` TEXT,
|
|
||||||
ADD UNIQUE `uniqueness` (`user_id`, `cache_key`, `uid`);
|
|
||||||
|
|
||||||
ALTER TABLE `identities`
|
|
||||||
ADD `html_signature` tinyint(1) default 0 NOT NULL;
|
|
||||||
|
|
||||||
ALTER TABLE `session` CHANGE `ip` `ip` VARCHAR(40)
|
ALTER TABLE `cache`
|
||||||
|
DROP INDEX `cache_key`,
|
||||||
-- Uncomment these lines if you're using MySQL 4.1 or higher
|
DROP INDEX `session_id`,
|
||||||
-- ALTER TABLE `users`
|
ADD INDEX `user_cache_index` (`user_id`,`cache_key`);
|
||||||
-- DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci,
|
|
||||||
-- CHANGE `username` `username` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
|
||||||
-- CHANGE `alias` `alias` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
-- RoundCube Webmail update script for Postres databases
|
-- RoundCube Webmail update script for Postgres databases
|
||||||
-- Updates from version 0.1-beta and older
|
-- Updates from version 0.1-stable to 0.1.1
|
||||||
|
|
||||||
ALTER TABLE "messages" DROP body;
|
|
||||||
ALTER TABLE "messages" ADD structure TEXT;
|
|
||||||
ALTER TABLE "messages" ADD UNIQUE (user_id, cache_key, uid);
|
|
||||||
|
|
||||||
ALTER TABLE "identities" ADD html_signature INTEGER;
|
|
||||||
ALTER TABLE "identities" ALTER html_signature SET DEFAULT 0;
|
|
||||||
UPDATE identities SET html_signature = 0;
|
|
||||||
ALTER TABLE "identities" ALTER html_signature SET NOT NULL;
|
|
||||||
|
|
||||||
|
ALTER TABLE "cache" ADD INDEX (user_id, cache_key);
|
||||||
|
Loading…
Reference in New Issue