Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 205 lines (162 sloc) 5.294 kb
e019f2d @alecpl - s/RoundCube/Roundcube/
alecpl authored
1 -- Roundcube Webmail initial database structure
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
2
3 --
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
4 -- Table structure for table contacts and related
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
5 --
6
7 CREATE TABLE contacts (
8 contact_id integer NOT NULL PRIMARY KEY,
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148…
alecpl authored
9 user_id integer NOT NULL,
58e3602 @thomascube Bugfixes for encoding and sending with attachments
thomascube authored
10 changed datetime NOT NULL default '0000-00-00 00:00:00',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
11 del tinyint NOT NULL default '0',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
12 name varchar(128) NOT NULL default '',
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148…
alecpl authored
13 email text NOT NULL default '',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
14 firstname varchar(128) NOT NULL default '',
15 surname varchar(128) NOT NULL default '',
3e26373 @thomascube Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANG…
thomascube authored
16 vcard text NOT NULL default '',
17 words text NOT NULL default ''
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
18 );
19
48be8f6 @alecpl - Fix SQL Error when saving a contact with many email addresses (#148…
alecpl authored
20 CREATE INDEX ix_contacts_user_id ON contacts(user_id, del);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
21
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
22
23 CREATE TABLE contactgroups (
24 contactgroup_id integer NOT NULL PRIMARY KEY,
25 user_id integer NOT NULL default '0',
26 changed datetime NOT NULL default '0000-00-00 00:00:00',
27 del tinyint NOT NULL default '0',
28 name varchar(128) NOT NULL default ''
29 );
30
31 CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del);
32
33
34 CREATE TABLE contactgroupmembers (
35 contactgroup_id integer NOT NULL,
36 contact_id integer NOT NULL default '0',
37 created datetime NOT NULL default '0000-00-00 00:00:00',
38 PRIMARY KEY (contactgroup_id, contact_id)
39 );
40
3a5476d @alecpl - Add index on contactgroupmembers.contact_id column.
alecpl authored
41 CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
42
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
43 --
44 -- Table structure for table identities
45 --
46
47 CREATE TABLE identities (
48 identity_id integer NOT NULL PRIMARY KEY,
49 user_id integer NOT NULL default '0',
a35062a @thomascube Always set changed date when marking a DB record as deleted + provide…
thomascube authored
50 changed datetime NOT NULL default '0000-00-00 00:00:00',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
51 del tinyint NOT NULL default '0',
52 standard tinyint NOT NULL default '0',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
53 name varchar(128) NOT NULL default '',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
54 organization varchar(128) default '',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
55 email varchar(128) NOT NULL default '',
56 "reply-to" varchar(128) NOT NULL default '',
57 bcc varchar(128) NOT NULL default '',
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and …
svncommit authored
58 signature text NOT NULL default '',
59 html_signature tinyint NOT NULL default '0'
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
60 );
61
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
62 CREATE INDEX ix_identities_user_id ON identities(user_id, del);
565c472 @alecpl Removed users.alias column, added option ('user_aliases')
alecpl authored
63 CREATE INDEX ix_identities_email ON identities(email, del);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
64
65 --
66 -- Table structure for table users
67 --
68
69 CREATE TABLE users (
70 user_id integer NOT NULL PRIMARY KEY,
71 username varchar(128) NOT NULL default '',
72 mail_host varchar(128) NOT NULL default '',
73 created datetime NOT NULL default '0000-00-00 00:00:00',
e2402ef @alecpl - Set DEFAULT NULL for users.last_login
alecpl authored
74 last_login datetime DEFAULT NULL,
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
75 language varchar(5),
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
76 preferences text NOT NULL default ''
77 );
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
78
ace511a @alecpl - Add unique index on users.username+users.mail_host
alecpl authored
79 CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host);
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
80
81 --
82 -- Table structure for table session
83 --
84
85 CREATE TABLE session (
b8ae0ec @alecpl - Fixed bug where session ID's length was limited to 40 characters. S…
alecpl authored
86 sess_id varchar(128) NOT NULL PRIMARY KEY,
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
87 created datetime NOT NULL default '0000-00-00 00:00:00',
88 changed datetime NOT NULL default '0000-00-00 00:00:00',
84d06ed @thomascube IPv6 Compatability
thomascube authored
89 ip varchar(40) NOT NULL default '',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
90 vars text NOT NULL
91 );
92
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
93 CREATE INDEX ix_session_changed ON session (changed);
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
94
66df084 @alecpl - Merge devel-spellcheck branch:
alecpl authored
95 --
96 -- Table structure for table dictionary
97 --
98
99 CREATE TABLE dictionary (
100 user_id integer DEFAULT NULL,
101 "language" varchar(5) NOT NULL,
102 data text NOT NULL
103 );
104
105 CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language");
106
f8e48df @alecpl - Merge devel-saved_search branch (Addressbook Saved Searches)
alecpl authored
107 --
108 -- Table structure for table searches
109 --
110
111 CREATE TABLE searches (
112 search_id integer NOT NULL PRIMARY KEY,
113 user_id integer NOT NULL DEFAULT '0',
114 "type" smallint NOT NULL DEFAULT '0',
115 name varchar(128) NOT NULL,
116 data text NOT NULL
117 );
118
bd9190a @alecpl - Fix broken CREATE INDEX queries in SQLite DDL files (#1488255)
alecpl authored
119 CREATE UNIQUE INDEX ix_searches_user_type_name ON searches (user_id, type, name);
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
120
50abd55 @alecpl Added shared (cross-user) cache
alecpl authored
121 --
122 -- Table structure for table cache
123 --
124
125 CREATE TABLE cache (
126 user_id integer NOT NULL default 0,
127 cache_key varchar(128) NOT NULL default '',
128 created datetime NOT NULL default '0000-00-00 00:00:00',
8483de8 @alecpl Fix typo
alecpl authored
129 expires datetime DEFAULT NULL,
50abd55 @alecpl Added shared (cross-user) cache
alecpl authored
130 data text NOT NULL
131 );
132
133 CREATE INDEX ix_cache_user_cache_key ON cache(user_id, cache_key);
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
134 CREATE INDEX ix_cache_expires ON cache(expires);
50abd55 @alecpl Added shared (cross-user) cache
alecpl authored
135
136 --
137 -- Table structure for table cache_shared
138 --
139
140 CREATE TABLE cache_shared (
141 cache_key varchar(255) NOT NULL,
142 created datetime NOT NULL default '0000-00-00 00:00:00',
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
143 expires datetime DEFAULT NULL,
50abd55 @alecpl Added shared (cross-user) cache
alecpl authored
144 data text NOT NULL
145 );
146
147 CREATE INDEX ix_cache_shared_cache_key ON cache_shared(cache_key);
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
148 CREATE INDEX ix_cache_shared_expires ON cache_shared(expires);
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
149
150 --
151 -- Table structure for table cache_index
152 --
153
154 CREATE TABLE cache_index (
155 user_id integer NOT NULL,
156 mailbox varchar(255) NOT NULL,
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
157 expires datetime DEFAULT NULL,
609d392 @alecpl - Cache synchronization using QRESYNC/CONDSTORE
alecpl authored
158 valid smallint NOT NULL DEFAULT '0',
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
159 data text NOT NULL,
160 PRIMARY KEY (user_id, mailbox)
161 );
162
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
163 CREATE INDEX ix_cache_index_expires ON cache_index (expires);
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
164
165 --
166 -- Table structure for table cache_thread
167 --
168
169 CREATE TABLE cache_thread (
170 user_id integer NOT NULL,
171 mailbox varchar(255) NOT NULL,
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
172 expires datetime DEFAULT NULL,
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
173 data text NOT NULL,
174 PRIMARY KEY (user_id, mailbox)
175 );
176
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
177 CREATE INDEX ix_cache_thread_expires ON cache_thread (expires);
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
178
179 --
180 -- Table structure for table cache_messages
181 --
182
183 CREATE TABLE cache_messages (
184 user_id integer NOT NULL,
185 mailbox varchar(255) NOT NULL,
186 uid integer NOT NULL,
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
187 expires datetime DEFAULT NULL,
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
188 data text NOT NULL,
609d392 @alecpl - Cache synchronization using QRESYNC/CONDSTORE
alecpl authored
189 flags integer NOT NULL DEFAULT '0',
80152b3 @alecpl - Rewritten messages caching (merged devel-mcache branch):
alecpl authored
190 PRIMARY KEY (user_id, mailbox, uid)
191 );
192
60b6d7c @alecpl Fix database cache expunge issues (#1489149) - added 'expires' column
alecpl authored
193 CREATE INDEX ix_cache_messages_expires ON cache_messages (expires);
b7e7c8f @alecpl Added new database upgrade script, converted DDL scripts to new format
alecpl authored
194
195 --
196 -- Table structure for table system
197 --
198
199 CREATE TABLE system (
200 name varchar(64) NOT NULL PRIMARY KEY,
201 value text NOT NULL
202 );
203
f06f4b8 @alecpl Fix storing signatures with big images in MySQL database (#1490306)
alecpl authored
204 INSERT INTO system (name, value) VALUES ('roundcube-version', '2015030800');
Something went wrong with that request. Please try again.