Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 360 lines (303 sloc) 12.545 kb
107bde9c » thomascube
2006-08-30 Added MSSQL support
1 CREATE TABLE [dbo].[cache] (
2 [user_id] [int] NOT NULL ,
3 [cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
4 [created] [datetime] NOT NULL ,
5 [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
6 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
7 GO
8
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
9 CREATE TABLE [dbo].[cache_index] (
10 [user_id] [int] NOT NULL ,
11 [mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
12 [changed] [datetime] NOT NULL ,
609d3923 » alecpl
2011-09-18 - Cache synchronization using QRESYNC/CONDSTORE
13 [valid] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
14 [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
15 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
16 GO
17
18 CREATE TABLE [dbo].[cache_thread] (
19 [user_id] [int] NOT NULL ,
20 [mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
21 [changed] [datetime] NOT NULL ,
22 [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
23 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
24 GO
25
26 CREATE TABLE [dbo].[cache_messages] (
27 [user_id] [int] NOT NULL ,
28 [mailbox] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
29 [uid] [int] NOT NULL ,
30 [changed] [datetime] NOT NULL ,
ccce87d7 » alecpl
2012-02-07 - Fix parse errors in DDL files for MS SQL Server
31 [data] [text] COLLATE Latin1_General_CI_AI NOT NULL ,
32 [flags] [int] NOT NULL
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
33 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
34 GO
35
107bde9c » thomascube
2006-08-30 Added MSSQL support
36 CREATE TABLE [dbo].[contacts] (
37 [contact_id] [int] IDENTITY (1, 1) NOT NULL ,
38 [user_id] [int] NOT NULL ,
39 [changed] [datetime] NOT NULL ,
40 [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
41 [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
6237c947 » alecpl
2012-06-08 Fix operator incompat. in some queries on contacts table using MS SQL…
42 [email] [varchar] (8000) COLLATE Latin1_General_CI_AI NOT NULL ,
107bde9c » thomascube
2006-08-30 Added MSSQL support
43 [firstname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
44 [surname] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
3e263735 » thomascube
2011-02-14 Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANG…
45 [vcard] [text] COLLATE Latin1_General_CI_AI NULL ,
46 [words] [text] COLLATE Latin1_General_CI_AI NULL
107bde9c » thomascube
2006-08-30 Added MSSQL support
47 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
48 GO
49
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
50 CREATE TABLE [dbo].[contactgroups] (
51 [contactgroup_id] [int] IDENTITY (1, 1) NOT NULL ,
52 [user_id] [int] NOT NULL ,
53 [changed] [datetime] NOT NULL ,
54 [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
55 [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
56 ) ON [PRIMARY]
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
57 GO
58
59 CREATE TABLE [dbo].[contactgroupmembers] (
60 [contactgroup_id] [int] NOT NULL ,
61 [contact_id] [int] NOT NULL ,
62 [created] [datetime] NOT NULL
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
63 ) ON [PRIMARY]
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
64 GO
65
107bde9c » thomascube
2006-08-30 Added MSSQL support
66 CREATE TABLE [dbo].[identities] (
67 [identity_id] [int] IDENTITY (1, 1) NOT NULL ,
68 [user_id] [int] NOT NULL ,
a35062a1 » thomascube
2010-04-15 Always set changed date when marking a DB record as deleted + provide…
69 [changed] [datetime] NOT NULL ,
107bde9c » thomascube
2006-08-30 Added MSSQL support
70 [del] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
71 [standard] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL ,
72 [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
73 [organization] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
74 [email] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
75 [reply-to] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
76 [bcc] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
7c6bc1a1 » alecpl
2009-08-03 - Fix MS SQL DDL (#1486020)
77 [signature] [text] COLLATE Latin1_General_CI_AI NULL,
97840cb7 » alecpl
2008-12-03 - added lost column in mssql DDL
78 [html_signature] [char] (1) COLLATE Latin1_General_CI_AI NOT NULL
107bde9c » thomascube
2006-08-30 Added MSSQL support
79 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
80 GO
81
82 CREATE TABLE [dbo].[session] (
b8ae0ecb » alecpl
2011-11-22 - Fixed bug where session ID's length was limited to 40 characters. S…
83 [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
107bde9c » thomascube
2006-08-30 Added MSSQL support
84 [created] [datetime] NOT NULL ,
85 [changed] [datetime] NULL ,
84d06edb » thomascube
2007-09-19 IPv6 Compatability
86 [ip] [varchar] (40) COLLATE Latin1_General_CI_AI NOT NULL ,
107bde9c » thomascube
2006-08-30 Added MSSQL support
87 [vars] [text] COLLATE Latin1_General_CI_AI NOT NULL
88 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
89 GO
90
91 CREATE TABLE [dbo].[users] (
92 [user_id] [int] IDENTITY (1, 1) NOT NULL ,
93 [username] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
94 [mail_host] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
95 [created] [datetime] NOT NULL ,
e2402ef9 » alecpl
2010-04-28 - Set DEFAULT NULL for users.last_login
96 [last_login] [datetime] NULL ,
debdda01 » alecpl
2008-11-25 #1485420: remove default (and not null) for users.language column in DDL
97 [language] [varchar] (5) COLLATE Latin1_General_CI_AI NULL ,
7c6bc1a1 » alecpl
2009-08-03 - Fix MS SQL DDL (#1486020)
98 [preferences] [text] COLLATE Latin1_General_CI_AI NULL
107bde9c » thomascube
2006-08-30 Added MSSQL support
99 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
100 GO
101
66df0842 » alecpl
2011-09-06 - Merge devel-spellcheck branch:
102 CREATE TABLE [dbo].[dictionary] (
103 [user_id] [int] ,
104 [language] [varchar] (5) COLLATE Latin1_General_CI_AI NOT NULL ,
105 [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
106 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
107 GO
108
f8e48df7 » alecpl
2011-09-06 - Merge devel-saved_search branch (Addressbook Saved Searches)
109 CREATE TABLE [dbo].[searches] (
110 [search_id] [int] IDENTITY (1, 1) NOT NULL ,
111 [user_id] [int] NOT NULL ,
112 [type] [tinyint] NOT NULL ,
113 [name] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
114 [data] [text] COLLATE Latin1_General_CI_AI NOT NULL
115 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
116 GO
117
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
118 ALTER TABLE [dbo].[cache_index] WITH NOCHECK ADD
119 PRIMARY KEY CLUSTERED
120 (
121 [user_id],[mailbox]
122 ) ON [PRIMARY]
123 GO
124
125 ALTER TABLE [dbo].[cache_thread] WITH NOCHECK ADD
126 PRIMARY KEY CLUSTERED
127 (
128 [user_id],[mailbox]
129 ) ON [PRIMARY]
130 GO
131
132 ALTER TABLE [dbo].[cache_messages] WITH NOCHECK ADD
133 PRIMARY KEY CLUSTERED
134 (
135 [user_id],[mailbox],[uid]
136 ) ON [PRIMARY]
137 GO
138
107bde9c » thomascube
2006-08-30 Added MSSQL support
139 ALTER TABLE [dbo].[contacts] WITH NOCHECK ADD
140 CONSTRAINT [PK_contacts_contact_id] PRIMARY KEY CLUSTERED
141 (
142 [contact_id]
143 ) ON [PRIMARY]
144 GO
145
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
146 ALTER TABLE [dbo].[contactgroups] WITH NOCHECK ADD
147 CONSTRAINT [PK_contactgroups_contactgroup_id] PRIMARY KEY CLUSTERED
148 (
149 [contactgroup_id]
150 ) ON [PRIMARY]
151 GO
152
153 ALTER TABLE [dbo].[contactgroupmembers] WITH NOCHECK ADD
154 CONSTRAINT [PK_contactgroupmembers_id] PRIMARY KEY CLUSTERED
155 (
156 [contactgroup_id], [contact_id]
157 ) ON [PRIMARY]
158 GO
159
107bde9c » thomascube
2006-08-30 Added MSSQL support
160 ALTER TABLE [dbo].[identities] WITH NOCHECK ADD
161 PRIMARY KEY CLUSTERED
162 (
163 [identity_id]
164 ) ON [PRIMARY]
165 GO
166
167 ALTER TABLE [dbo].[session] WITH NOCHECK ADD
168 CONSTRAINT [PK_session_sess_id] PRIMARY KEY CLUSTERED
169 (
170 [sess_id]
171 ) ON [PRIMARY]
172 GO
173
174 ALTER TABLE [dbo].[users] WITH NOCHECK ADD
175 CONSTRAINT [PK_users_user_id] PRIMARY KEY CLUSTERED
176 (
177 [user_id]
178 ) ON [PRIMARY]
179 GO
180
f8e48df7 » alecpl
2011-09-06 - Merge devel-saved_search branch (Addressbook Saved Searches)
181 ALTER TABLE [dbo].[searches] WITH NOCHECK ADD
182 CONSTRAINT [PK_searches_search_id] PRIMARY KEY CLUSTERED
183 (
184 [search_id]
185 ) ON [PRIMARY]
186 GO
187
107bde9c » thomascube
2006-08-30 Added MSSQL support
188 ALTER TABLE [dbo].[cache] ADD
189 CONSTRAINT [DF_cache_user_id] DEFAULT ('0') FOR [user_id],
190 CONSTRAINT [DF_cache_cache_key] DEFAULT ('') FOR [cache_key],
191 CONSTRAINT [DF_cache_created] DEFAULT (getdate()) FOR [created]
192 GO
193
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
194 CREATE INDEX [IX_cache_user_id] ON [dbo].[cache]([user_id]) ON [PRIMARY]
107bde9c » thomascube
2006-08-30 Added MSSQL support
195 GO
196
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
197 CREATE INDEX [IX_cache_cache_key] ON [dbo].[cache]([cache_key]) ON [PRIMARY]
107bde9c » thomascube
2006-08-30 Added MSSQL support
198 GO
199
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
200 CREATE INDEX [IX_cache_created] ON [dbo].[cache]([created]) ON [PRIMARY]
e4d9f05e » alecpl
2008-11-24 - Added index on cache.created + small fixes in mssql DDL script
201 GO
202
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
203 ALTER TABLE [dbo].[cache_index] ADD
7b2bf71c » alecpl
2011-09-19 - Add lost cache_index.valid column definition
204 CONSTRAINT [DF_cache_index_changed] DEFAULT (getdate()) FOR [changed],
205 CONSTRAINT [DF_cache_index_valid] DEFAULT ('0') FOR [valid]
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
206 GO
207
208 CREATE INDEX [IX_cache_index_user_id] ON [dbo].[cache_index]([user_id]) ON [PRIMARY]
209 GO
210
211 ALTER TABLE [dbo].[cache_thread] ADD
212 CONSTRAINT [DF_cache_thread_changed] DEFAULT (getdate()) FOR [changed]
213 GO
214
215 CREATE INDEX [IX_cache_thread_user_id] ON [dbo].[cache_thread]([user_id]) ON [PRIMARY]
216 GO
217
218 ALTER TABLE [dbo].[cache_messages] ADD
7b2bf71c » alecpl
2011-09-19 - Add lost cache_index.valid column definition
219 CONSTRAINT [DF_cache_messages_changed] DEFAULT (getdate()) FOR [changed],
ccce87d7 » alecpl
2012-02-07 - Fix parse errors in DDL files for MS SQL Server
220 CONSTRAINT [DF_cache_messages_flags] DEFAULT (0) FOR [flags]
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
221 GO
222
223 CREATE INDEX [IX_cache_messages_user_id] ON [dbo].[cache_messages]([user_id]) ON [PRIMARY]
224 GO
225
107bde9c » thomascube
2006-08-30 Added MSSQL support
226 ALTER TABLE [dbo].[contacts] ADD
227 CONSTRAINT [DF_contacts_user_id] DEFAULT (0) FOR [user_id],
228 CONSTRAINT [DF_contacts_changed] DEFAULT (getdate()) FOR [changed],
229 CONSTRAINT [DF_contacts_del] DEFAULT ('0') FOR [del],
230 CONSTRAINT [DF_contacts_name] DEFAULT ('') FOR [name],
231 CONSTRAINT [DF_contacts_email] DEFAULT ('') FOR [email],
232 CONSTRAINT [DF_contacts_firstname] DEFAULT ('') FOR [firstname],
233 CONSTRAINT [DF_contacts_surname] DEFAULT ('') FOR [surname],
234 CONSTRAINT [CK_contacts_del] CHECK ([del] = '1' or [del] = '0')
235 GO
236
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
237 CREATE INDEX [IX_contacts_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY]
238 GO
239
240 ALTER TABLE [dbo].[contactgroups] ADD
241 CONSTRAINT [DF_contactgroups_user_id] DEFAULT (0) FOR [user_id],
242 CONSTRAINT [DF_contactgroups_changed] DEFAULT (getdate()) FOR [changed],
243 CONSTRAINT [DF_contactgroups_del] DEFAULT ('0') FOR [del],
244 CONSTRAINT [DF_contactgroups_name] DEFAULT ('') FOR [name],
245 CONSTRAINT [CK_contactgroups_del] CHECK ([del] = '1' or [del] = '0')
246 GO
247
248 CREATE INDEX [IX_contactgroups_user_id] ON [dbo].[contacts]([user_id]) ON [PRIMARY]
107bde9c » thomascube
2006-08-30 Added MSSQL support
249 GO
250
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
251 ALTER TABLE [dbo].[contactgroupmembers] ADD
252 CONSTRAINT [DF_contactgroupmembers_contactgroup_id] DEFAULT (0) FOR [contactgroup_id],
253 CONSTRAINT [DF_contactgroupmembers_contact_id] DEFAULT (0) FOR [contact_id],
254 CONSTRAINT [DF_contactgroupmembers_created] DEFAULT (getdate()) FOR [created]
255 GO
256
3a5476d1 » alecpl
2011-02-23 - Add index on contactgroupmembers.contact_id column.
257 CREATE INDEX [IX_contactgroupmembers_contact_id] ON [dbo].[contactgroupmembers]([contact_id]) ON [PRIMARY]
258 GO
96f9653e » thomascube
2010-04-23 Updated mssql schema (I have no clue if this is correct)
259
107bde9c » thomascube
2006-08-30 Added MSSQL support
260 ALTER TABLE [dbo].[identities] ADD
261 CONSTRAINT [DF_identities_user] DEFAULT ('0') FOR [user_id],
262 CONSTRAINT [DF_identities_del] DEFAULT ('0') FOR [del],
263 CONSTRAINT [DF_identities_standard] DEFAULT ('0') FOR [standard],
264 CONSTRAINT [DF_identities_name] DEFAULT ('') FOR [name],
265 CONSTRAINT [DF_identities_organization] DEFAULT ('') FOR [organization],
266 CONSTRAINT [DF_identities_email] DEFAULT ('') FOR [email],
267 CONSTRAINT [DF_identities_reply] DEFAULT ('') FOR [reply-to],
268 CONSTRAINT [DF_identities_bcc] DEFAULT ('') FOR [bcc],
7c6bc1a1 » alecpl
2009-08-03 - Fix MS SQL DDL (#1486020)
269 CONSTRAINT [DF_identities_html_signature] DEFAULT ('0') FOR [html_signature],
107bde9c » thomascube
2006-08-30 Added MSSQL support
270 CHECK ([standard] = '1' or [standard] = '0'),
271 CHECK ([del] = '1' or [del] = '0')
272 GO
273
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
274 CREATE INDEX [IX_identities_user_id] ON [dbo].[identities]([user_id]) ON [PRIMARY]
107bde9c » thomascube
2006-08-30 Added MSSQL support
275 GO
565c4729 » alecpl
2012-08-06 Removed users.alias column, added option ('user_aliases')
276 CREATE INDEX [IX_identities_email] ON [dbo].[identities]([email],[del]) ON [PRIMARY]
277 GO
107bde9c » thomascube
2006-08-30 Added MSSQL support
278
279 ALTER TABLE [dbo].[session] ADD
280 CONSTRAINT [DF_session_sess_id] DEFAULT ('') FOR [sess_id],
281 CONSTRAINT [DF_session_created] DEFAULT (getdate()) FOR [created],
282 CONSTRAINT [DF_session_ip] DEFAULT ('') FOR [ip]
283 GO
284
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
285 CREATE INDEX [IX_session_changed] ON [dbo].[session]([changed]) ON [PRIMARY]
3e48d2ee » alecpl
2008-11-21 - Increase speed of session destroy and garbage clean up
286 GO
287
107bde9c » thomascube
2006-08-30 Added MSSQL support
288 ALTER TABLE [dbo].[users] ADD
289 CONSTRAINT [DF_users_username] DEFAULT ('') FOR [username],
290 CONSTRAINT [DF_users_mail_host] DEFAULT ('') FOR [mail_host],
7c6bc1a1 » alecpl
2009-08-03 - Fix MS SQL DDL (#1486020)
291 CONSTRAINT [DF_users_created] DEFAULT (getdate()) FOR [created]
107bde9c » thomascube
2006-08-30 Added MSSQL support
292 GO
293
ace511a7 » alecpl
2010-10-06 - Add unique index on users.username+users.mail_host
294 CREATE UNIQUE INDEX [IX_users_username] ON [dbo].[users]([username],[mail_host]) ON [PRIMARY]
e4d9f05e » alecpl
2008-11-24 - Added index on cache.created + small fixes in mssql DDL script
295 GO
296
66df0842 » alecpl
2011-09-06 - Merge devel-spellcheck branch:
297 CREATE UNIQUE INDEX [IX_dictionary_user_language] ON [dbo].[dictionary]([user_id],[language]) ON [PRIMARY]
298 GO
299
f8e48df7 » alecpl
2011-09-06 - Merge devel-saved_search branch (Addressbook Saved Searches)
300 ALTER TABLE [dbo].[searches] ADD
301 CONSTRAINT [DF_searches_user] DEFAULT (0) FOR [user_id],
ccce87d7 » alecpl
2012-02-07 - Fix parse errors in DDL files for MS SQL Server
302 CONSTRAINT [DF_searches_type] DEFAULT (0) FOR [type]
f8e48df7 » alecpl
2011-09-06 - Merge devel-saved_search branch (Addressbook Saved Searches)
303 GO
304
305 CREATE UNIQUE INDEX [IX_searches_user_type_name] ON [dbo].[searches]([user_id],[type],[name]) ON [PRIMARY]
306 GO
307
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
308 ALTER TABLE [dbo].[identities] ADD CONSTRAINT [FK_identities_user_id]
309 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
310 ON DELETE CASCADE ON UPDATE CASCADE
311 GO
312
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
313 ALTER TABLE [dbo].[contacts] ADD CONSTRAINT [FK_contacts_user_id]
314 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
315 ON DELETE CASCADE ON UPDATE CASCADE
316 GO
317
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
318 ALTER TABLE [dbo].[contactgroups] ADD CONSTRAINT [FK_contactgroups_user_id]
319 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
320 ON DELETE CASCADE ON UPDATE CASCADE
321 GO
322
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
323 ALTER TABLE [dbo].[cache] ADD CONSTRAINT [FK_cache_user_id]
324 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
325 ON DELETE CASCADE ON UPDATE CASCADE
326 GO
327
80152b33 » alecpl
2011-09-07 - Rewritten messages caching (merged devel-mcache branch):
328 ALTER TABLE [dbo].[cache_index] ADD CONSTRAINT [FK_cache_index_user_id]
329 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
330 ON DELETE CASCADE ON UPDATE CASCADE
331 GO
332
333 ALTER TABLE [dbo].[cache_thread] ADD CONSTRAINT [FK_cache_thread_user_id]
334 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
335 ON DELETE CASCADE ON UPDATE CASCADE
336 GO
337
338 ALTER TABLE [dbo].[cache_messages] ADD CONSTRAINT [FK_cache_messages_user_id]
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
339 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
340 ON DELETE CASCADE ON UPDATE CASCADE
341 GO
342
ac189817 » alecpl
2010-08-11 - Fixes in SQL init script + added update script for MSSQL database
343 ALTER TABLE [dbo].[contactgroupmembers] ADD CONSTRAINT [FK_contactgroupmembers_contactgroup_id]
344 FOREIGN KEY ([contactgroup_id]) REFERENCES [dbo].[contactgroups] ([contactgroup_id])
3cf0993f » alecpl
2010-04-23 - added foreign keys in mssql DDL
345 ON DELETE CASCADE ON UPDATE CASCADE
346 GO
347
f8e48df7 » alecpl
2011-09-06 - Merge devel-saved_search branch (Addressbook Saved Searches)
348 ALTER TABLE [dbo].[searches] ADD CONSTRAINT [FK_searches_user_id]
349 FOREIGN KEY ([user_id]) REFERENCES [dbo].[users] ([user_id])
350 ON DELETE CASCADE ON UPDATE CASCADE
351 GO
352
87101332 » alecpl
2010-11-15 - Fix error in MSSQL DDL scripts (#1487112): use trigger instead of f…
353 -- Use trigger instead of foreign key (#1487112)
354 -- "Introducing FOREIGN KEY constraint ... may cause cycles or multiple cascade paths."
355 CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
356 AFTER DELETE AS
357 DELETE FROM [dbo].[contactgroupmembers]
358 WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
e4d9f05e » alecpl
2008-11-24 - Added index on cache.created + small fixes in mssql DDL script
359 GO
360
Something went wrong with that request. Please try again.