Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 179 lines (138 sloc) 5.057 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 --
4 -- Table structure for table `cache`
5 --
6
7 CREATE TABLE cache (
8 cache_id integer NOT NULL PRIMARY KEY,
9 user_id integer NOT NULL default 0,
10 cache_key varchar(128) NOT NULL default '',
11 created datetime NOT NULL default '0000-00-00 00:00:00',
12 data longtext NOT NULL
13 );
14
ac26b96 @thomascube Optimize database schema; get rid of unnecessary indexes
thomascube authored
15 CREATE INDEX ix_cache_user_cache_key ON cache(user_id, cache_key);
e4d9f05 @alecpl - Added index on cache.created + small fixes in mssql DDL script
alecpl authored
16 CREATE INDEX ix_cache_created ON cache(created);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
17
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
18
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
19 -- --------------------------------------------------------
20
21 --
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
22 -- Table structure for table contacts and related
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
23 --
24
25 CREATE TABLE contacts (
26 contact_id integer NOT NULL PRIMARY KEY,
27 user_id integer NOT NULL default '0',
58e3602 @thomascube Bugfixes for encoding and sending with attachments
thomascube authored
28 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
29 del tinyint NOT NULL default '0',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
30 name varchar(128) NOT NULL default '',
6f09681 @alecpl - Support contact's email addresses up to 255 characters long (#1487095)
alecpl authored
31 email varchar(255) NOT NULL default '',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
32 firstname varchar(128) NOT NULL default '',
33 surname varchar(128) NOT NULL default '',
3e26373 @thomascube Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANG…
thomascube authored
34 vcard text NOT NULL default '',
35 words text NOT NULL default ''
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
36 );
37
23b7656 @alecpl - use better index for contacts table
alecpl authored
38 CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
39
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
40
41 CREATE TABLE contactgroups (
42 contactgroup_id integer NOT NULL PRIMARY KEY,
43 user_id integer NOT NULL default '0',
44 changed datetime NOT NULL default '0000-00-00 00:00:00',
45 del tinyint NOT NULL default '0',
46 name varchar(128) NOT NULL default ''
47 );
48
49 CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del);
50
51
52 CREATE TABLE contactgroupmembers (
53 contactgroup_id integer NOT NULL,
54 contact_id integer NOT NULL default '0',
55 created datetime NOT NULL default '0000-00-00 00:00:00',
56 PRIMARY KEY (contactgroup_id, contact_id)
57 );
58
3a5476d @alecpl - Add index on contactgroupmembers.contact_id column.
alecpl authored
59 CREATE INDEX ix_contactgroupmembers_contact_id ON contactgroupmembers (contact_id);
60
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
61
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
62 -- --------------------------------------------------------
63
64 --
65 -- Table structure for table identities
66 --
67
68 CREATE TABLE identities (
69 identity_id integer NOT NULL PRIMARY KEY,
70 user_id integer NOT NULL default '0',
a35062a @thomascube Always set changed date when marking a DB record as deleted + provide…
thomascube authored
71 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
72 del tinyint NOT NULL default '0',
73 standard tinyint NOT NULL default '0',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
74 name varchar(128) NOT NULL default '',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
75 organization varchar(128) default '',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
76 email varchar(128) NOT NULL default '',
77 "reply-to" varchar(128) NOT NULL default '',
78 bcc varchar(128) NOT NULL default '',
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and …
svncommit authored
79 signature text NOT NULL default '',
80 html_signature tinyint NOT NULL default '0'
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
81 );
82
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
alecpl authored
83 CREATE INDEX ix_identities_user_id ON identities(user_id, del);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
84
85
86 -- --------------------------------------------------------
87
88 --
89 -- Table structure for table users
90 --
91
92 CREATE TABLE users (
93 user_id integer NOT NULL PRIMARY KEY,
94 username varchar(128) NOT NULL default '',
95 mail_host varchar(128) NOT NULL default '',
96 alias varchar(128) NOT NULL default '',
97 created datetime NOT NULL default '0000-00-00 00:00:00',
e2402ef @alecpl - Set DEFAULT NULL for users.last_login
alecpl authored
98 last_login datetime DEFAULT NULL,
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
99 language varchar(5),
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
100 preferences text NOT NULL default ''
101 );
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
102
ace511a @alecpl - Add unique index on users.username+users.mail_host
alecpl authored
103 CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host);
6cb7786 @alecpl #1484854
alecpl authored
104 CREATE INDEX ix_users_alias ON users(alias);
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
105
106 -- --------------------------------------------------------
107
108 --
109 -- Table structure for table session
110 --
111
112 CREATE TABLE session (
113 sess_id varchar(40) NOT NULL PRIMARY KEY,
114 created datetime NOT NULL default '0000-00-00 00:00:00',
115 changed datetime NOT NULL default '0000-00-00 00:00:00',
84d06ed @thomascube IPv6 Compatability
thomascube authored
116 ip varchar(40) NOT NULL default '',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
117 vars text NOT NULL
118 );
119
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
120 CREATE INDEX ix_session_changed ON session (changed);
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
121
122 -- --------------------------------------------------------
123
124 --
125 -- Table structure for table messages
126 --
127
128 CREATE TABLE messages (
129 message_id integer NOT NULL PRIMARY KEY,
130 user_id integer NOT NULL default '0',
131 del tinyint NOT NULL default '0',
132 cache_key varchar(128) NOT NULL default '',
b594741 @thomascube Add created date to message cache
thomascube authored
133 created 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
134 idx integer NOT NULL default '0',
135 uid integer NOT NULL default '0',
136 subject varchar(255) NOT NULL default '',
137 "from" varchar(255) NOT NULL default '',
138 "to" varchar(255) NOT NULL default '',
ac26b96 @thomascube Optimize database schema; get rid of unnecessary indexes
thomascube authored
139 "cc" varchar(255) NOT NULL default '',
140 "date" 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
141 size integer NOT NULL default '0',
142 headers text NOT NULL,
f7bfec9 @thomascube Finalized new message parsing. Attention: changes in database schema
thomascube authored
143 structure text
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Pos…
thomascube authored
144 );
145
3d601d2 @alecpl - added index in messages table
alecpl authored
146 CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
147 CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
c98f3b5 @alecpl #1485125: added index on messages.created
alecpl authored
148 CREATE INDEX ix_messages_created ON messages (created);
66df084 @alecpl - Merge devel-spellcheck branch:
alecpl authored
149
150 -- --------------------------------------------------------
151
152 --
153 -- Table structure for table dictionary
154 --
155
156 CREATE TABLE dictionary (
157 user_id integer DEFAULT NULL,
158 "language" varchar(5) NOT NULL,
159 data text NOT NULL
160 );
161
162 CREATE UNIQUE INDEX ix_dictionary_user_language ON dictionary (user_id, "language");
163
f8e48df @alecpl - Merge devel-saved_search branch (Addressbook Saved Searches)
alecpl authored
164 -- --------------------------------------------------------
165
166 --
167 -- Table structure for table searches
168 --
169
170 CREATE TABLE searches (
171 search_id integer NOT NULL PRIMARY KEY,
172 user_id integer NOT NULL DEFAULT '0',
173 "type" smallint NOT NULL DEFAULT '0',
174 name varchar(128) NOT NULL,
175 data text NOT NULL
176 );
177
178 CREATE UNIQUE INDEX ix_searches_user_type_name (user_id, type, name);
Something went wrong with that request. Please try again.