Skip to content

HTTPS clone URL

Subversion checkout URL

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