Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 146 lines (114 sloc) 4.252 kb
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
1 -- RoundCube Webmail initial database structure
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; Postgr...
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; Postgr...
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 '',
31 email varchar(128) NOT NULL default '',
32 firstname varchar(128) NOT NULL default '',
33 surname varchar(128) NOT NULL default '',
34 vcard text NOT NULL default ''
35 );
36
23b7656 @alecpl - use better index for contacts table
alecpl authored
37 CREATE INDEX ix_contacts_user_id ON contacts(user_id, email);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
38
a61bbb2 @thomascube Added basic contact groups feature
thomascube authored
39
40 CREATE TABLE contactgroups (
41 contactgroup_id integer NOT NULL PRIMARY KEY,
42 user_id integer NOT NULL default '0',
43 changed datetime NOT NULL default '0000-00-00 00:00:00',
44 del tinyint NOT NULL default '0',
45 name varchar(128) NOT NULL default ''
46 );
47
48 CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del);
49
50
51 CREATE TABLE contactgroupmembers (
52 contactgroup_id integer NOT NULL,
53 contact_id integer NOT NULL default '0',
54 created datetime NOT NULL default '0000-00-00 00:00:00',
55 PRIMARY KEY (contactgroup_id, contact_id)
56 );
57
58
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
59 -- --------------------------------------------------------
60
61 --
62 -- Table structure for table identities
63 --
64
65 CREATE TABLE identities (
66 identity_id integer NOT NULL PRIMARY KEY,
67 user_id integer NOT NULL default '0',
a35062a @thomascube Always set changed date when marking a DB record as deleted + provide a ...
thomascube authored
68 changed datetime NOT NULL default '0000-00-00 00:00:00',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
69 del tinyint NOT NULL default '0',
70 standard tinyint NOT NULL default '0',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
71 name varchar(128) NOT NULL default '',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
72 organization varchar(128) default '',
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
73 email varchar(128) NOT NULL default '',
74 "reply-to" varchar(128) NOT NULL default '',
75 bcc varchar(128) NOT NULL default '',
a0109c4 Initial TinyMCE editor support (still need to work on spellcheck and ski...
svncommit authored
76 signature text NOT NULL default '',
77 html_signature tinyint NOT NULL default '0'
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
78 );
79
94fe9ca @alecpl - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in identiti...
alecpl authored
80 CREATE INDEX ix_identities_user_id ON identities(user_id, del);
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
81
82
83 -- --------------------------------------------------------
84
85 --
86 -- Table structure for table users
87 --
88
89 CREATE TABLE users (
90 user_id integer NOT NULL PRIMARY KEY,
91 username varchar(128) NOT NULL default '',
92 mail_host varchar(128) NOT NULL default '',
93 alias varchar(128) NOT NULL default '',
94 created datetime NOT NULL default '0000-00-00 00:00:00',
95 last_login datetime NOT NULL default '0000-00-00 00:00:00',
debdda0 @alecpl #1485420: remove default (and not null) for users.language column in DDL
alecpl authored
96 language varchar(5),
79fe17f @thomascube Added SQLite supprt and MySQL update script
thomascube authored
97 preferences text NOT NULL default ''
98 );
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
99
6cb7786 @alecpl #1484854
alecpl authored
100 CREATE INDEX ix_users_username ON users(username);
101 CREATE INDEX ix_users_alias ON users(alias);
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
102
103 -- --------------------------------------------------------
104
105 --
106 -- Table structure for table session
107 --
108
109 CREATE TABLE session (
110 sess_id varchar(40) NOT NULL PRIMARY KEY,
111 created datetime NOT NULL default '0000-00-00 00:00:00',
112 changed datetime NOT NULL default '0000-00-00 00:00:00',
84d06ed @thomascube IPv6 Compatability
thomascube authored
113 ip varchar(40) NOT NULL default '',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
114 vars text NOT NULL
115 );
116
3e48d2e @alecpl - Increase speed of session destroy and garbage clean up
alecpl authored
117 CREATE INDEX ix_session_changed ON session (changed);
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
118
119 -- --------------------------------------------------------
120
121 --
122 -- Table structure for table messages
123 --
124
125 CREATE TABLE messages (
126 message_id integer NOT NULL PRIMARY KEY,
127 user_id integer NOT NULL default '0',
128 del tinyint NOT NULL default '0',
129 cache_key varchar(128) NOT NULL default '',
b594741 @thomascube Add created date to message cache
thomascube authored
130 created datetime NOT NULL default '0000-00-00 00:00:00',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
131 idx integer NOT NULL default '0',
132 uid integer NOT NULL default '0',
133 subject varchar(255) NOT NULL default '',
134 "from" varchar(255) NOT NULL default '',
135 "to" varchar(255) NOT NULL default '',
ac26b96 @thomascube Optimize database schema; get rid of unnecessary indexes
thomascube authored
136 "cc" varchar(255) NOT NULL default '',
137 "date" datetime NOT NULL default '0000-00-00 00:00:00',
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
138 size integer NOT NULL default '0',
139 headers text NOT NULL,
f7bfec9 @thomascube Finalized new message parsing. Attention: changes in database schema
thomascube authored
140 structure text
1cded85 @thomascube Re-design of caching (new database table added\!); some bugfixes; Postgr...
thomascube authored
141 );
142
3d601d2 @alecpl - added index in messages table
alecpl authored
143 CREATE UNIQUE INDEX ix_messages_user_cache_uid ON messages (user_id,cache_key,uid);
144 CREATE INDEX ix_messages_index ON messages (user_id,cache_key,idx);
c98f3b5 @alecpl #1485125: added index on messages.created
alecpl authored
145 CREATE INDEX ix_messages_created ON messages (created);
Something went wrong with that request. Please try again.