1 -- RoundCube Webmail initial database structure
5 -- --------------------------------------------------------
8 -- Table structure for table `cache`
12 cache_id integer NOT NULL PRIMARY KEY,
13 user_id integer NOT NULL default 0,
14 session_id varchar(40) default NULL,
15 cache_key varchar(128) NOT NULL default '',
16 created datetime NOT NULL default '0000-00-00 00:00:00',
17 data longtext NOT NULL
20 CREATE INDEX ix_cache_user_id ON cache(user_id);
21 CREATE INDEX ix_cache_cache_key ON cache(cache_key);
22 CREATE INDEX ix_cache_session_id ON cache(session_id);
25 -- --------------------------------------------------------
28 -- Table structure for table contacts
31 CREATE TABLE contacts (
32 contact_id integer NOT NULL PRIMARY KEY,
33 user_id integer NOT NULL default '0',
34 changed datetime NOT NULL default '0000-00-00 00:00:00',
35 del tinyint NOT NULL default '0',
36 name varchar(128) NOT NULL default '',
37 email varchar(128) NOT NULL default '',
38 firstname varchar(128) NOT NULL default '',
39 surname varchar(128) NOT NULL default '',
40 vcard text NOT NULL default ''
43 CREATE INDEX ix_contacts_user_id ON contacts(user_id);
45 -- --------------------------------------------------------
48 -- Table structure for table identities
51 CREATE TABLE identities (
52 identity_id integer NOT NULL PRIMARY KEY,
53 user_id integer NOT NULL default '0',
54 del tinyint NOT NULL default '0',
55 standard tinyint NOT NULL default '0',
56 name varchar(128) NOT NULL default '',
57 organization varchar(128) default '',
58 email varchar(128) NOT NULL default '',
59 "reply-to" varchar(128) NOT NULL default '',
60 bcc varchar(128) NOT NULL default '',
61 signature text NOT NULL default '',
62 html_signature tinyint NOT NULL default '0'
65 CREATE INDEX ix_identities_user_id ON identities(user_id);
68 -- --------------------------------------------------------
71 -- Table structure for table users
75 user_id integer NOT NULL PRIMARY KEY,
76 username varchar(128) NOT NULL default '',
77 mail_host varchar(128) NOT NULL default '',
78 alias varchar(128) NOT NULL default '',
79 created datetime NOT NULL default '0000-00-00 00:00:00',
80 last_login datetime NOT NULL default '0000-00-00 00:00:00',
81 language varchar(5) NOT NULL default 'en',
82 preferences text NOT NULL default ''
86 -- --------------------------------------------------------
89 -- Table structure for table session
92 CREATE TABLE session (
93 sess_id varchar(40) NOT NULL PRIMARY KEY,
94 created datetime NOT NULL default '0000-00-00 00:00:00',
95 changed datetime NOT NULL default '0000-00-00 00:00:00',
96 ip varchar(40) NOT NULL default '',
101 -- --------------------------------------------------------
104 -- Table structure for table messages
107 CREATE TABLE messages (
108 message_id integer NOT NULL PRIMARY KEY,
109 user_id integer NOT NULL default '0',
110 del tinyint NOT NULL default '0',
111 cache_key varchar(128) NOT NULL default '',
112 created datetime NOT NULL default '0000-00-00 00:00:00',
113 idx integer NOT NULL default '0',
114 uid integer NOT NULL default '0',
115 subject varchar(255) NOT NULL default '',
116 "from" varchar(255) NOT NULL default '',
117 "to" varchar(255) NOT NULL default '',
118 cc varchar(255) NOT NULL default '',
119 date datetime NOT NULL default '0000-00-00 00:00:00',
120 size integer NOT NULL default '0',
121 headers text NOT NULL,
125 CREATE INDEX ix_messages_user_id ON messages(user_id);
126 CREATE INDEX ix_messages_cache_key ON messages(cache_key);
127 CREATE INDEX ix_messages_idx ON messages(idx);
128 CREATE INDEX ix_messages_uid ON messages(uid);