Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 134 lines (98 sloc) 4.764 kB
e019f2d @alecpl - s/RoundCube/Roundcube/
alecpl 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
3d601d2 @alecpl - added index in messages table
alecpl authored
56 -- Updates from version 0.3-stable
57
f47e2dc @alecpl - move TRUNCATE before CREATE INDEX (#1486362)
alecpl authored
58 TRUNCATE `messages`;
59
3d601d2 @alecpl - added index in messages table
alecpl authored
60 ALTER TABLE `messages`
61 ADD INDEX `index_index` (`user_id`, `cache_key`, `idx`);
7fec6b2 @alecpl - "TRUNCATE messages" is required to remove buggy cache entries
alecpl authored
62
b2b8b19 @vbenincasa - Change MySQL data type to avoid problems with big session vars
vbenincasa authored
63 ALTER TABLE `session`
64 CHANGE `vars` `vars` MEDIUMTEXT NOT NULL;
23b7656 @alecpl - use better index for contacts table
alecpl authored
65
66 ALTER TABLE `contacts`
67 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
68
69 -- Updates from version 0.3.1
fc55295 @alecpl - Added warning about tables engine, per discussion in #1486794
alecpl authored
70 -- WARNING: Make sure that all tables are using InnoDB engine!!!
71 -- If not, use: ALTER TABLE xxx ENGINE=InnoDB;
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
72
73 /* MySQL bug workaround: http://bugs.mysql.com/bug.php?id=46293 */
5cec0c6 @alecpl - typo
alecpl authored
74 /*!40014 SET FOREIGN_KEY_CHECKS=0 */;
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=4629…
alecpl authored
75
76 ALTER TABLE `messages` DROP FOREIGN KEY `user_id_fk_messages`;
77 ALTER TABLE `cache` DROP FOREIGN KEY `user_id_fk_cache`;
78 ALTER TABLE `contacts` DROP FOREIGN KEY `user_id_fk_contacts`;
79 ALTER TABLE `identities` DROP FOREIGN KEY `user_id_fk_identities`;
80
81 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
82 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
83 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
84 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
85 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
86 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
87 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
88 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
89
951c07b @alecpl - Fix adding contacts SQL error on mysql (#1486459)
alecpl authored
90 ALTER TABLE `contacts` ALTER `name` SET DEFAULT '';
91 ALTER TABLE `contacts` ALTER `firstname` SET DEFAULT '';
92 ALTER TABLE `contacts` ALTER `surname` SET DEFAULT '';
93
ac756e8 @alecpl - fix add index
alecpl authored
94 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
95 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
96
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
97 CREATE TABLE `contactgroups` (
98 `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
99 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
1924136 @alecpl - fix default datetime
alecpl authored
100 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
101 `del` tinyint(1) NOT NULL DEFAULT '0',
102 `name` varchar(128) NOT NULL DEFAULT '',
103 PRIMARY KEY(`contactgroup_id`),
104 CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
105 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
106 INDEX `contactgroups_user_index` (`user_id`,`del`)
107 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
108
109 CREATE TABLE `contactgroupmembers` (
110 `contactgroup_id` int(10) UNSIGNED NOT NULL,
111 `contact_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
1924136 @alecpl - fix default datetime
alecpl authored
112 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
113 PRIMARY KEY (`contactgroup_id`, `contact_id`),
114 CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
115 REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
116 CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
117 REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE
118 ) /*!40000 ENGINE=INNODB */;
119
5cec0c6 @alecpl - typo
alecpl authored
120 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;
e2402ef @alecpl - Set DEFAULT NULL for users.last_login
alecpl authored
121
122 -- Updates from version 0.4-beta
123
124 ALTER TABLE `users` CHANGE `last_login` `last_login` datetime DEFAULT NULL;
125 UPDATE `users` SET `last_login` = NULL WHERE `last_login` = '1000-01-01 00:00:00';
ace511a @alecpl - Add unique index on users.username+users.mail_host
alecpl authored
126
127 -- Updates from version 0.4.2
128
129 ALTER TABLE `users` DROP INDEX `username_index`;
130 ALTER TABLE `users` ADD UNIQUE `username` (`username`, `mail_host`);
131
6f09681 @alecpl - Support contact's email addresses up to 255 characters long (#1487095)
alecpl authored
132 ALTER TABLE `contacts` MODIFY `email` varchar(255) NOT NULL;
133
Something went wrong with that request. Please try again.