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