Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 267 lines (221 sloc) 7.319 kb
e019f2d0 »
2010-09-25 - s/RoundCube/Roundcube/
1 -- Roundcube Webmail initial database structure
798ad5ea »
2009-05-14 - remove version number from *.initial.sql
2
977a295e »
2005-12-16 Usage of virtusertable; mail_domain for new users; Chinese and Turkis…
3 --
4 -- Sequence "user_ids"
5 -- Name: user_ids; Type: SEQUENCE; Schema: public; Owner: postgres
6 --
7
8 CREATE SEQUENCE user_ids
9 INCREMENT BY 1
10 NO MAXVALUE
11 NO MINVALUE
12 CACHE 1;
13
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
14 --
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
15 -- Table "users"
16 -- Name: users; Type: TABLE; Schema: public; Owner: postgres
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
17 --
18
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
19 CREATE TABLE users (
15a9d1ce »
2006-01-05 Optimized loading time; added periodic mail check; added EXPUNGE command
20 user_id integer DEFAULT nextval('user_ids'::text) PRIMARY KEY,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
21 username varchar(128) DEFAULT '' NOT NULL,
22 mail_host varchar(128) DEFAULT '' NOT NULL,
23 alias varchar(128) DEFAULT '' NOT NULL,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
24 created timestamp with time zone DEFAULT now() NOT NULL,
e2402ef9 »
2010-04-28 - Set DEFAULT NULL for users.last_login
25 last_login timestamp with time zone DEFAULT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
26 "language" varchar(5),
ace511a7 »
2010-10-06 - Add unique index on users.username+users.mail_host
27 preferences text DEFAULT ''::text NOT NULL,
8381ec12 »
2011-03-10 - Force names of unique constraints in PostgreSQL DDL (postgres 9.x u…
28 CONSTRAINT users_username_key UNIQUE (username, mail_host)
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
29 );
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
30
6cb77869 »
2008-04-03 #1484854
31 CREATE INDEX users_alias_id_idx ON users (alias);
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
32
b5947413 »
2006-01-25 Add created date to message cache
33
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
34 --
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
35 -- Table "session"
36 -- Name: session; Type: TABLE; Schema: public; Owner: postgres
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
37 --
38
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
39 CREATE TABLE "session" (
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
40 sess_id varchar(40) DEFAULT '' PRIMARY KEY,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
41 created timestamp with time zone DEFAULT now() NOT NULL,
42 changed timestamp with time zone DEFAULT now() NOT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
43 ip varchar(41) NOT NULL,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
44 vars text NOT NULL
45 );
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
46
3e48d2ee »
2008-11-21 - Increase speed of session destroy and garbage clean up
47 CREATE INDEX session_changed_idx ON session (changed);
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
48
49
50 --
b5947413 »
2006-01-25 Add created date to message cache
51 -- Sequence "identity_ids"
52 -- Name: identity_ids; Type: SEQUENCE; Schema: public; Owner: postgres
53 --
54
55 CREATE SEQUENCE identity_ids
56 START WITH 1
57 INCREMENT BY 1
58 NO MAXVALUE
59 NO MINVALUE
60 CACHE 1;
61
62 --
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
63 -- Table "identities"
64 -- Name: identities; Type: TABLE; Schema: public; Owner: postgres
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
65 --
66
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
67 CREATE TABLE identities (
15a9d1ce »
2006-01-05 Optimized loading time; added periodic mail check; added EXPUNGE command
68 identity_id integer DEFAULT nextval('identity_ids'::text) PRIMARY KEY,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
69 user_id integer NOT NULL
70 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
a35062a1 »
2010-04-15 Always set changed date when marking a DB record as deleted + provide…
71 changed timestamp with time zone DEFAULT now() NOT NULL,
a493ea8e »
2008-12-03 - change few "boolean" columns type from integer to smallint
72 del smallint DEFAULT 0 NOT NULL,
73 standard smallint DEFAULT 0 NOT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
74 name varchar(128) NOT NULL,
75 organization varchar(128),
76 email varchar(128) NOT NULL,
77 "reply-to" varchar(128),
78 bcc varchar(128),
a0109c49 »
2006-09-14 Initial TinyMCE editor support (still need to work on spellcheck and …
79 signature text,
80 html_signature integer DEFAULT 0 NOT NULL
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
81 );
82
94fe9ca1 »
2010-03-06 - re-fix (#1486474) + require MySQL 4.0.8 + add index/update in ident…
83 CREATE INDEX identities_user_id_idx ON identities (user_id, del);
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
84
b5947413 »
2006-01-25 Add created date to message cache
85
86 --
87 -- Sequence "contact_ids"
88 -- Name: contact_ids; Type: SEQUENCE; Schema: public; Owner: postgres
89 --
90
91 CREATE SEQUENCE contact_ids
92 START WITH 1
93 INCREMENT BY 1
94 NO MAXVALUE
95 NO MINVALUE
96 CACHE 1;
97
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
98 --
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
99 -- Table "contacts"
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
100 -- Name: contacts; Type: TABLE; Schema: public; Owner: postgres
101 --
102
103 CREATE TABLE contacts (
15a9d1ce »
2006-01-05 Optimized loading time; added periodic mail check; added EXPUNGE command
104 contact_id integer DEFAULT nextval('contact_ids'::text) PRIMARY KEY,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
105 user_id integer NOT NULL
3e263735 »
2011-02-14 Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANG…
106 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
107 changed timestamp with time zone DEFAULT now() NOT NULL,
a493ea8e »
2008-12-03 - change few "boolean" columns type from integer to smallint
108 del smallint DEFAULT 0 NOT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
109 name varchar(128) DEFAULT '' NOT NULL,
6f096812 »
2010-11-02 - Support contact's email addresses up to 255 characters long (#1487095)
110 email varchar(255) DEFAULT '' NOT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
111 firstname varchar(128) DEFAULT '' NOT NULL,
112 surname varchar(128) DEFAULT '' NOT NULL,
3e263735 »
2011-02-14 Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANG…
113 vcard text,
114 words text
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
115 );
116
23b76563 »
2009-09-29 - use better index for contacts table
117 CREATE INDEX contacts_user_id_idx ON contacts (user_id, email);
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
118
119 --
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
120 -- Sequence "contactgroups_ids"
121 -- Name: contactgroups_ids; Type: SEQUENCE; Schema: public; Owner: postgres
122 --
123
124 CREATE SEQUENCE contactgroups_ids
125 INCREMENT BY 1
126 NO MAXVALUE
127 NO MINVALUE
128 CACHE 1;
129
130 --
131 -- Table "contactgroups"
132 -- Name: contactgroups; Type: TABLE; Schema: public; Owner: postgres
133 --
134
135 CREATE TABLE contactgroups (
136 contactgroup_id integer DEFAULT nextval('contactgroups_ids'::text) PRIMARY KEY,
137 user_id integer NOT NULL
138 REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE,
139 changed timestamp with time zone DEFAULT now() NOT NULL,
140 del smallint NOT NULL DEFAULT 0,
141 name varchar(128) NOT NULL DEFAULT ''
142 );
143
144 CREATE INDEX contactgroups_user_id_idx ON contactgroups (user_id, del);
145
146 --
147 -- Table "contactgroupmembers"
148 -- Name: contactgroupmembers; Type: TABLE; Schema: public; Owner: postgres
149 --
ace511a7 »
2010-10-06 - Add unique index on users.username+users.mail_host
150
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
151 CREATE TABLE contactgroupmembers (
152 contactgroup_id integer NOT NULL
153 REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE,
154 contact_id integer NOT NULL
155 REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE,
156 created timestamp with time zone DEFAULT now() NOT NULL,
157 PRIMARY KEY (contactgroup_id, contact_id)
158 );
159
3a5476d1 »
2011-02-23 - Add index on contactgroupmembers.contact_id column.
160 CREATE INDEX contactgroupmembers_contact_id_idx ON contactgroupmembers (contact_id);
161
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
162 --
b5947413 »
2006-01-25 Add created date to message cache
163 -- Sequence "cache_ids"
164 -- Name: cache_ids; Type: SEQUENCE; Schema: public; Owner: postgres
165 --
166
167 CREATE SEQUENCE cache_ids
168 INCREMENT BY 1
169 NO MAXVALUE
170 NO MINVALUE
171 CACHE 1;
172
173 --
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
174 -- Table "cache"
175 -- Name: cache; Type: TABLE; Schema: public; Owner: postgres
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
176 --
177
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
178 CREATE TABLE "cache" (
15a9d1ce »
2006-01-05 Optimized loading time; added periodic mail check; added EXPUNGE command
179 cache_id integer DEFAULT nextval('cache_ids'::text) PRIMARY KEY,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
180 user_id integer NOT NULL
181 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
182 cache_key varchar(128) DEFAULT '' NOT NULL,
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
183 created timestamp with time zone DEFAULT now() NOT NULL,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
184 data text NOT NULL
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
185 );
186
edc63c2e »
2008-04-03 fix: there's no ALTER TABLE ... ADD INDEX in postgresql
187 CREATE INDEX cache_user_id_idx ON "cache" (user_id, cache_key);
e4d9f05e »
2008-11-24 - Added index on cache.created + small fixes in mssql DDL script
188 CREATE INDEX cache_created_idx ON "cache" (created);
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
189
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
190 --
b5947413 »
2006-01-25 Add created date to message cache
191 -- Sequence "message_ids"
192 -- Name: message_ids; Type: SEQUENCE; Schema: public; Owner: postgres
193 --
194
195 CREATE SEQUENCE message_ids
196 INCREMENT BY 1
197 NO MAXVALUE
198 NO MINVALUE
199 CACHE 1;
200
201 --
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
202 -- Table "messages"
203 -- Name: messages; Type: TABLE; Schema: public; Owner: postgres
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
204 --
205
c98f3b5d »
2008-06-12 #1485125: added index on messages.created
206 CREATE TABLE messages (
15a9d1ce »
2006-01-05 Optimized loading time; added periodic mail check; added EXPUNGE command
207 message_id integer DEFAULT nextval('message_ids'::text) PRIMARY KEY,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
208 user_id integer NOT NULL
209 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
a493ea8e »
2008-12-03 - change few "boolean" columns type from integer to smallint
210 del smallint DEFAULT 0 NOT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
211 cache_key varchar(128) DEFAULT '' NOT NULL,
b5947413 »
2006-01-25 Add created date to message cache
212 created timestamp with time zone DEFAULT now() NOT NULL,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
213 idx integer DEFAULT 0 NOT NULL,
214 uid integer DEFAULT 0 NOT NULL,
22d6b534 »
2010-03-27 - contactgroups DDL for postgres
215 subject varchar(128) DEFAULT '' NOT NULL,
216 "from" varchar(128) DEFAULT '' NOT NULL,
217 "to" varchar(128) DEFAULT '' NOT NULL,
218 cc varchar(128) DEFAULT '' NOT NULL,
1cded857 »
2005-12-03 Re-design of caching (new database table added\!); some bugfixes; Pos…
219 date timestamp with time zone NOT NULL,
220 size integer DEFAULT 0 NOT NULL,
221 headers text NOT NULL,
ace511a7 »
2010-10-06 - Add unique index on users.username+users.mail_host
222 structure text,
8381ec12 »
2011-03-10 - Force names of unique constraints in PostgreSQL DDL (postgres 9.x u…
223 CONSTRAINT messages_user_id_key UNIQUE (user_id, cache_key, uid)
f5dc2a42 »
2005-10-02 more changes to reflect postgres support
224 );
225
3d601d26 »
2009-09-07 - added index in messages table
226 CREATE INDEX messages_index_idx ON messages (user_id, cache_key, idx);
c98f3b5d »
2008-06-12 #1485125: added index on messages.created
227 CREATE INDEX messages_created_idx ON messages (created);
66df0842 »
2011-09-06 - Merge devel-spellcheck branch:
228
229 --
230 -- Table "dictionary"
231 -- Name: dictionary; Type: TABLE; Schema: public; Owner: postgres
232 --
233
234 CREATE TABLE dictionary (
235 user_id integer DEFAULT NULL
236 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
237 "language" varchar(5) NOT NULL,
238 data text NOT NULL,
239 CONSTRAINT dictionary_user_id_language_key UNIQUE (user_id, "language")
240 );
f8e48df7 »
2011-09-06 - Merge devel-saved_search branch (Addressbook Saved Searches)
241
242 --
243 -- Sequence "searches_ids"
244 -- Name: searches_ids; Type: SEQUENCE; Schema: public; Owner: postgres
245 --
246
247 CREATE SEQUENCE search_ids
248 INCREMENT BY 1
249 NO MAXVALUE
250 NO MINVALUE
251 CACHE 1;
252
253 --
254 -- Table "searches"
255 -- Name: searches; Type: TABLE; Schema: public; Owner: postgres
256 --
257
258 CREATE TABLE searches (
259 search_id integer DEFAULT nextval('search_ids'::text) PRIMARY KEY,
260 user_id integer NOT NULL
261 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
262 "type" smallint DEFAULT 0 NOT NULL,
263 name varchar(128) NOT NULL,
264 data text NOT NULL,
265 CONSTRAINT searches_user_id_key UNIQUE (user_id, "type", name)
266 );
Something went wrong with that request. Please try again.