Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 193 lines (156 sloc) 7.362 kb
e019f2d @alecpl - s/RoundCube/Roundcube/
alecpl authored
1 -- Roundcube Webmail initial database structure
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
2
3
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
4 /*!40014 SET FOREIGN_KEY_CHECKS=0 */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
5
6 -- Table structure for table `session`
7
8 CREATE TABLE `session` (
b8ae0ec @alecpl - Fixed bug where session ID's length was limited to 40 characters. Sinc...
alecpl authored
9 `sess_id` varchar(128) NOT NULL,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
10 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
11 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
84d06ed @thomascube IPv6 Compatability
thomascube authored
12 `ip` varchar(40) NOT NULL,
b2b8b19 @vbenincasa - Change MySQL data type to avoid problems with big session vars
vbenincasa authored
13 `vars` mediumtext NOT NULL,
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
14 PRIMARY KEY(`sess_id`),
15 INDEX `changed_index` (`changed`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
16 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
17
18
19 -- Table structure for table `users`
20
21 CREATE TABLE `users` (
22 `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
d5ae977 @alecpl - Fix username case-insensitivity issue in MySQL (#1488021)
alecpl authored
23 `username` varchar(128) BINARY NOT NULL,
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
24 `mail_host` varchar(128) NOT NULL,
d5ae977 @alecpl - Fix username case-insensitivity issue in MySQL (#1488021)
alecpl authored
25 `alias` varchar(128) BINARY NOT NULL,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
26 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
e2402ef @alecpl - Set DEFAULT NULL for users.last_login
alecpl authored
27 `last_login` datetime DEFAULT NULL,
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
28 `language` varchar(5),
112bff6 @thomascube Set prefs field in user table to null (#1484386)
thomascube authored
29 `preferences` text,
6cb7786 @alecpl #1484854
alecpl authored
30 PRIMARY KEY(`user_id`),
ace511a @alecpl - Add unique index on users.username+users.mail_host
alecpl authored
31 UNIQUE `username` (`username`, `mail_host`),
6cb7786 @alecpl #1484854
alecpl authored
32 INDEX `alias_index` (`alias`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
33 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
34
35
36 -- Table structure for table `cache`
37
38 CREATE TABLE `cache` (
39 `cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
40 `cache_key` varchar(128) /*!40101 CHARACTER SET ascii COLLATE ascii_general_ci */ NOT NULL ,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
41 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
42 `data` longtext NOT NULL,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
43 `user_id` int(10) UNSIGNED NOT NULL,
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
44 PRIMARY KEY(`cache_id`),
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
45 CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
46 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
e4d9f05 @alecpl - Added index on cache.created + small fixes in mssql DDL script
alecpl authored
47 INDEX `created_index` (`created`),
8248e4a @alecpl - Add workaround for MySQL bug [http://bugs.mysql.com/bug.php?id=46293] ...
alecpl authored
48 INDEX `user_cache_index` (`user_id`,`cache_key`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
49 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
50
51
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
52 -- Table structure for table `cache_index`
53
54 CREATE TABLE `cache_index` (
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
55 `user_id` int(10) UNSIGNED NOT NULL,
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
56 `mailbox` varchar(255) BINARY NOT NULL,
57 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
609d392 @alecpl - Cache synchronization using QRESYNC/CONDSTORE
alecpl authored
58 `valid` tinyint(1) NOT NULL DEFAULT '0',
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
59 `data` longtext NOT NULL,
60 CONSTRAINT `user_id_fk_cache_index` FOREIGN KEY (`user_id`)
61 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
62 INDEX `changed_index` (`changed`),
63 PRIMARY KEY (`user_id`, `mailbox`)
64 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
65
66
67 -- Table structure for table `cache_thread`
68
69 CREATE TABLE `cache_thread` (
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
70 `user_id` int(10) UNSIGNED NOT NULL,
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
71 `mailbox` varchar(255) BINARY NOT NULL,
72 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
73 `data` longtext NOT NULL,
74 CONSTRAINT `user_id_fk_cache_thread` FOREIGN KEY (`user_id`)
75 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
76 INDEX `changed_index` (`changed`),
77 PRIMARY KEY (`user_id`, `mailbox`)
78 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
79
80
81 -- Table structure for table `cache_messages`
82
83 CREATE TABLE `cache_messages` (
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
84 `user_id` int(10) UNSIGNED NOT NULL,
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
85 `mailbox` varchar(255) BINARY NOT NULL,
86 `uid` int(11) UNSIGNED NOT NULL DEFAULT '0',
87 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
88 `data` longtext NOT NULL,
609d392 @alecpl - Cache synchronization using QRESYNC/CONDSTORE
alecpl authored
89 `flags` int(11) NOT NULL DEFAULT '0',
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
90 CONSTRAINT `user_id_fk_cache_messages` FOREIGN KEY (`user_id`)
91 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
92 INDEX `changed_index` (`changed`),
93 PRIMARY KEY (`user_id`, `mailbox`, `uid`)
94 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
95
96
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
97 -- Table structure for table `contacts`
98
99 CREATE TABLE `contacts` (
100 `contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
37974e2 @alecpl - Fix datetime columns defaults in mysql's DDL (#1485641)
alecpl authored
101 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
102 `del` tinyint(1) NOT NULL DEFAULT '0',
951c07b @alecpl - Fix adding contacts SQL error on mysql (#1486459)
alecpl authored
103 `name` varchar(128) NOT NULL DEFAULT '',
3d4a482 @alecpl - Fix failure on MySQL database upgrade from 0.7 - text column can't hav...
alecpl authored
104 `email` text NOT NULL,
951c07b @alecpl - Fix adding contacts SQL error on mysql (#1486459)
alecpl authored
105 `firstname` varchar(128) NOT NULL DEFAULT '',
106 `surname` varchar(128) NOT NULL DEFAULT '',
09b0e36 @thomascube Change vcard field to LONGTEXT to completely store vcards with embedded ...
thomascube authored
107 `vcard` longtext NULL,
3e26373 @thomascube Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANGED\...
thomascube authored
108 `words` text NULL,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
109 `user_id` int(10) UNSIGNED NOT NULL,
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
110 PRIMARY KEY(`contact_id`),
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
111 CONSTRAINT `user_id_fk_contacts` FOREIGN KEY (`user_id`)
112 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
113 INDEX `user_contacts_index` (`user_id`,`del`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
114 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
115
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
116 -- Table structure for table `contactgroups`
117
118 CREATE TABLE `contactgroups` (
119 `contactgroup_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
120 `user_id` int(10) UNSIGNED NOT NULL,
1924136 @alecpl - fix default datetime
alecpl authored
121 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
122 `del` tinyint(1) NOT NULL DEFAULT '0',
123 `name` varchar(128) NOT NULL DEFAULT '',
124 PRIMARY KEY(`contactgroup_id`),
125 CONSTRAINT `user_id_fk_contactgroups` FOREIGN KEY (`user_id`)
126 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
127 INDEX `contactgroups_user_index` (`user_id`,`del`)
128 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
129
130 CREATE TABLE `contactgroupmembers` (
131 `contactgroup_id` int(10) UNSIGNED NOT NULL,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
132 `contact_id` int(10) UNSIGNED NOT NULL,
1924136 @alecpl - fix default datetime
alecpl authored
133 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
134 PRIMARY KEY (`contactgroup_id`, `contact_id`),
135 CONSTRAINT `contactgroup_id_fk_contactgroups` FOREIGN KEY (`contactgroup_id`)
136 REFERENCES `contactgroups`(`contactgroup_id`) ON DELETE CASCADE ON UPDATE CASCADE,
137 CONSTRAINT `contact_id_fk_contacts` FOREIGN KEY (`contact_id`)
3a5476d @alecpl - Add index on contactgroupmembers.contact_id column.
alecpl authored
138 REFERENCES `contacts`(`contact_id`) ON DELETE CASCADE ON UPDATE CASCADE,
139 INDEX `contactgroupmembers_contact_index` (`contact_id`)
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
140 ) /*!40000 ENGINE=INNODB */;
141
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
142
143 -- Table structure for table `identities`
144
145 CREATE TABLE `identities` (
146 `identity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
147 `user_id` int(10) UNSIGNED NOT NULL,
a35062a @thomascube Always set changed date when marking a DB record as deleted + provide a ...
thomascube authored
148 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
149 `del` tinyint(1) NOT NULL DEFAULT '0',
150 `standard` tinyint(1) NOT NULL DEFAULT '0',
151 `name` varchar(128) NOT NULL,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
152 `organization` varchar(128) NOT NULL DEFAULT '',
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
153 `email` varchar(128) NOT NULL,
d7f3d79 @alecpl -Fixed Mysql DDL for default identities creation (#1485070)
alecpl authored
154 `reply-to` varchar(128) NOT NULL DEFAULT '',
155 `bcc` varchar(128) NOT NULL DEFAULT '',
f18911a @alecpl - #1485120 (text column can't have a default value)
alecpl authored
156 `signature` text,
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and ski...
svncommit authored
157 `html_signature` tinyint(1) NOT NULL DEFAULT '0',
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
158 PRIMARY KEY(`identity_id`),
159 CONSTRAINT `user_id_fk_identities` FOREIGN KEY (`user_id`)
160 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
161 INDEX `user_identities_index` (`user_id`, `del`)
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
162 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
aade7b9 @thomascube Finalized 0.1beta2 release
thomascube authored
163
164
66df084 @alecpl - Merge devel-spellcheck branch:
alecpl authored
165 -- Table structure for table `dictionary`
166
167 CREATE TABLE `dictionary` (
168 `user_id` int(10) UNSIGNED DEFAULT NULL,
169 `language` varchar(5) NOT NULL,
170 `data` longtext NOT NULL,
171 CONSTRAINT `user_id_fk_dictionary` FOREIGN KEY (`user_id`)
172 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
173 UNIQUE `uniqueness` (`user_id`, `language`)
174 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
175
f8e48df @alecpl - Merge devel-saved_search branch (Addressbook Saved Searches)
alecpl authored
176
177 -- Table structure for table `searches`
178
179 CREATE TABLE `searches` (
180 `search_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148828...
alecpl authored
181 `user_id` int(10) UNSIGNED NOT NULL,
f8e48df @alecpl - Merge devel-saved_search branch (Addressbook Saved Searches)
alecpl authored
182 `type` int(3) NOT NULL DEFAULT '0',
183 `name` varchar(128) NOT NULL,
184 `data` text,
185 PRIMARY KEY(`search_id`),
186 CONSTRAINT `user_id_fk_searches` FOREIGN KEY (`user_id`)
187 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
188 UNIQUE `uniqueness` (`user_id`, `type`, `name`)
189 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
190
191
2bedfab @thomascube Add conditional comments to mysql initial script (#1485517); remove old ...
thomascube authored
192 /*!40014 SET FOREIGN_KEY_CHECKS=1 */;
Something went wrong with that request. Please try again.