Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 111 lines (83 sloc) 3.876 kB
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
1 -- RoundCube Webmail update script for MySQL databases
b2b8b19 @vbenincasa - Change MySQL data type to avoid problems with big session vars
vbenincasa authored
2 -- Updates from version 0.1-stable to 0.3.1
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
3
29451cf @thomascube Truncate cache table before adding index
thomascube authored
4 TRUNCATE TABLE `messages`;
5
f7bfec9 @thomascube Finalized new message parsing. Attention: changes in database schema
thomascube authored
6 ALTER TABLE `messages`
ac26b96 @thomascube Optimize database schema; get rid of unnecessary indexes
thomascube authored
7 DROP INDEX `idx`,
8 DROP INDEX `uid`;
5870871 @thomascube Changed sql scripts to allow non-ascii chars in user names (#1483959)
thomascube authored
9
ac26b96 @thomascube Optimize database schema; get rid of unnecessary indexes
thomascube authored
10 ALTER TABLE `cache`
11 DROP INDEX `cache_key`,
12 DROP INDEX `session_id`,
13 ADD INDEX `user_cache_index` (`user_id`,`cache_key`);
6cb7786 @alecpl #1484854
alecpl authored
14
15 ALTER TABLE `users`
f5e8d23 @alecpl #1484962: typo
alecpl authored
16 ADD INDEX `username_index` (`username`),
6cb7786 @alecpl #1484854
alecpl authored
17 ADD INDEX `alias_index` (`alias`);
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
18
19 -- Updates from version 0.1.1
20
21 ALTER TABLE `identities`
f18911a @alecpl - #1485120 (text column can't have a default value)
alecpl authored
22 MODIFY `signature` text,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
23 MODIFY `bcc` varchar(128) NOT NULL DEFAULT '',
24 MODIFY `reply-to` varchar(128) NOT NULL DEFAULT '',
25 MODIFY `organization` varchar(128) NOT NULL DEFAULT '',
26 MODIFY `name` varchar(128) NOT NULL,
27 MODIFY `email` varchar(128) NOT NULL;
c98f3b5 @alecpl #1485125: added index on messages.created
alecpl authored
28
29 -- Updates from version 0.2-alpha
30
31 ALTER TABLE `messages`
32 ADD INDEX `created_index` (`created`);
be7d3b6 @alecpl - Fix 'cache' table cleanup on session destroy (#1485516)
alecpl authored
33
34 -- Updates from version 0.2-beta (InnoDB only)
35
36 ALTER TABLE `cache`
dcf780a @alecpl - fix r2076: removed cache.session_id column, removed DELETEs from ca…
alecpl authored
37 DROP `session_id`;
38
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
39 ALTER TABLE `session`
40 ADD INDEX `changed_index` (`changed`);
e4d9f05 @alecpl - Added index on cache.created + small fixes in mssql DDL script
alecpl authored
41
42 ALTER TABLE `cache`
43 ADD INDEX `created_index` (`created`);
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
44
45 ALTER TABLE `users`
46 CHANGE `language` `language` varchar(5);
3d601d2 @alecpl - added index in messages table
alecpl authored
47
48 -- Updates from version 0.3-stable
49
f47e2dc @alecpl - move TRUNCATE before CREATE INDEX (#1486362)
alecpl authored
50 TRUNCATE `messages`;
51
3d601d2 @alecpl - added index in messages table
alecpl authored
52 ALTER TABLE `messages`
53 ADD INDEX `index_index` (`user_id`, `cache_key`, `idx`);
7fec6b2 @alecpl - "TRUNCATE messages" is required to remove buggy cache entries
alecpl authored
54
b2b8b19 @vbenincasa - Change MySQL data type to avoid problems with big session vars
vbenincasa authored
55 ALTER TABLE `session`
56 CHANGE `vars` `vars` MEDIUMTEXT NOT NULL;
23b7656 @alecpl - use better index for contacts table
alecpl authored
57
58 ALTER TABLE `contacts`
59 ADD INDEX `user_contacts_index` (`user_id`,`email`);
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
60
61 -- Updates from version 0.3.1
62
63 /* MySQL bug workaround: http://bugs.mysql.com/bug.php?id=46293 */
5cec0c6 @alecpl - typo
alecpl authored
64 /*!40014 SET FOREIGN_KEY_CHECKS=0 */;
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
65
66 ALTER TABLE `messages` DROP FOREIGN KEY `user_id_fk_messages`;
67 ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`;
68 ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
69 ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`;
70
71 ALTER TABLE `messages` ADD CONSTRAINT `user_id_fk_messages` FOREIGN KEY (`user_id`)
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
72 REFERENCES `users`(`user_id`);
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
73 ALTER TABLE `cache` ADD CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
74 REFERENCES `users`(`user_id`);
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
75 ALTER TABLE `contacts` ADD CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
76 REFERENCES `users`(`user_id`);
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
77 ALTER TABLE `identities` ADD CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
78 REFERENCES `users`(`user_id`);
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
79
951c07b @alecpl - Fix adding contacts SQL error on mysql (#1486459)
alecpl authored
80 ALTER TABLE `contacts` ALTER `name` SET DEFAULT '';
81 ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT '';
82 ALTER TABLE `contacts` ALTER `surname` SET DEFAULT '';
83
ac756e8 @alecpl - fix add index
alecpl authored
84 ALTER TABLE `identities` ADD INDEX `user_identities_index` (`user_id`, `del`);
a35062a @thomascube Always set changed date when marking a DB record as deleted + provide…
thomascube authored
85 ALTER TABLE `identities` ADD `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00' AFTER `user_id`;
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
86
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
87 CREATE TABLE `contactgroups` (
88 `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
89 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
1924136 @alecpl - fix default datetime
alecpl authored
90 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
91 `del` tinyint(1) NOT NULL DEFAULT '0',
92 `name` varchar(128) NOT NULL DEFAULT '',
93 PRIMARY KEY(`contactgroup_id`),
94 CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
95 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
96 INDEX `contactgroups_user_index` (`user_id`,`del`)
97 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
98
99 CREATE TABLE `contactgroupmembers` (
100 `contactgroup_id` int(10) UNSIGNED NOT NULL,
101 `contact_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
1924136 @alecpl - fix default datetime
alecpl authored
102 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
103 PRIMARY KEY (`contactgroup_id`, `contact_id`),
104 CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
105 REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
106 CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
107 REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE
108 ) /*!40000 ENGINE=INNODB */;
109
5cec0c6 @alecpl - typo
alecpl authored
110 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;
Something went wrong with that request. Please try again.