summaryrefslogtreecommitdiff
blob: d4a568297647bd645dbebb1157884fbb78e1edd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
diff -rNBwU 2 ../open-xchange-0.8.2-origin/conf/admintools.conf.in ./conf/admintools.conf.in
--- ../open-xchange-0.8.2-origin/conf/admintools.conf.in	2006-04-25 10:57:34.000000000 +0200
+++ ./conf/admintools.conf.in	2006-05-04 23:01:37.628100648 +0200
@@ -69,5 +69,5 @@
 DEFAULT_SQL_PASS="@dbpass@"
 ### if u want to use mysql change to mysql
-SQL_DB_TYPE="pgsql"
+SQL_DB_TYPE="mysql"
 
 
diff -rNBwU 2 ../open-xchange-0.8.2-origin/conf/groupware/intranet.conf ./conf/groupware/intranet.conf
--- ../open-xchange-0.8.2-origin/conf/groupware/intranet.conf	2006-04-25 10:57:34.000000000 +0200
+++ ./conf/groupware/intranet.conf	2006-05-04 23:01:37.629100496 +0200
@@ -130,16 +130,24 @@
 
 # DATABASE identifiert for SYSDATE
-SYSDATE='now'
+SYSDATE=now()
 
 # DATABASE identifier for CURRENT_DATE
-# SQL_TODAY='today'
+SQL_TODAY=curdate()
 
 # Sequence SQL-String for DATABASE
 # Example for POSTGRES
-seq-fid=SELECT nextval ('fid')
-seq-import_id=SELECT nextval ('import_id')
-seq-insert_id=SELECT nextval ('insert_id')
-seq-profile_id=SELECT nextval ('profile_id')
-seq-serial_id=SELECT nextval ('serial_id')
+#seq-fid=SELECT nextval ('fid')
+#seq-import_id=SELECT nextval ('import_id')
+#seq-insert_id=SELECT nextval ('insert_id')
+#seq-profile_id=SELECT nextval ('profile_id')
+#seq-serial_id=SELECT nextval ('serial_id')
+
+# Example for mySQL
+seq-fid=SELECT select_fid()
+seq-import_id=SELECT select_import_id()
+seq-insert_id=SELECT select_insert_id()
+seq-profile_id=SELECT select_profile_id()
+seq-serial_id=SELECT select_serial_id()
+
 # Example for ORACLE
 #seq-fid="SELECT fid.nextval"
diff -rNBwU 2 ../open-xchange-0.8.2-origin/conf/webmail/system.cfg ./conf/webmail/system.cfg
--- ../open-xchange-0.8.2-origin/conf/webmail/system.cfg	2006-04-25 10:57:34.000000000 +0200
+++ ./conf/webmail/system.cfg	2006-05-04 23:01:37.631100192 +0200
@@ -167,5 +167,5 @@
 
 # SQL Query to request a new sequence number
-seq-serial_id="SELECT nextval ('serial_id')"
+seq-serial_id="SELECT select_serial_id()"
 
 # SQL Query field mapping name(s). May needed when having problems with field
@@ -175,3 +175,3 @@
 #								^^^^^^^^^^^^^^^^^^^^^
 # 								usrdata		delete
-sql-fieldmapname-usrdata_delete="delete"
\ Kein Zeilenumbruch am Dateiende.
+sql-fieldmapname-usrdata_delete="delete_it"
diff -rNBwU 2 ../open-xchange-0.8.2-origin/configure.in ./configure.in
--- ../open-xchange-0.8.2-origin/configure.in	2006-04-25 10:57:34.000000000 +0200
+++ ./configure.in	2006-05-04 23:01:37.633099888 +0200
@@ -792,4 +792,5 @@
 conf/admintools.conf 
 system/setup/init_ldap.ldif
+system/setup/create_mysql_database.sql
 src/com/openexchange/server/Version.java )
 
diff -rNBwU 2 ../open-xchange-0.8.2-origin/src/com/openexchange/groupware/InsertHandler.java ./src/com/openexchange/groupware/InsertHandler.java
--- ../open-xchange-0.8.2-origin/src/com/openexchange/groupware/InsertHandler.java	2006-04-25 10:57:34.000000000 +0200
+++ ./src/com/openexchange/groupware/InsertHandler.java	2006-05-05 11:17:26.185499760 +0200
@@ -245,4 +245,6 @@
 		    setBinaryStreamFromFile(pst, value, a+1);
 		 }
+	    } else if (type.indexOf("TIMESTAMP") != -1 && (value != null && value.equals(GlobalConfig.getParameter("SYSDATE")))) {
+		    pst.setTimestamp(a+1,new java.sql.Timestamp(System.currentTimeMillis()));
 		} else if (type.indexOf("TIMESTAMP") != -1 && (value == null  || !value.equals(GlobalConfig.getParameter("SYSDATE")))) {
 		if (value == null) {
@@ -253,5 +255,7 @@
 			try {
 			tsf.setCalendar(value, GlobalConfig.getDateTimePattern("DATABASE"));
-			} catch(Exception e) { e.printStackTrace(); }
+			} catch(Exception e) { 
+				e.printStackTrace(); 
+			}
 		   pst.setTimestamp(a+1,new java.sql.Timestamp(tsf.getDate().getTime()));
 		}
diff -rNBwU 2 ../open-xchange-0.8.2-origin/src/com/openexchange/groupware/UpdateHandler.java ./src/com/openexchange/groupware/UpdateHandler.java
--- ../open-xchange-0.8.2-origin/src/com/openexchange/groupware/UpdateHandler.java	2006-04-25 10:57:34.000000000 +0200
+++ ./src/com/openexchange/groupware/UpdateHandler.java	2006-05-05 11:18:36.848757312 +0200
@@ -251,4 +251,6 @@
 		    setBinaryStreamFromFile(pst, value, a+1);
 		}
+            } else if (type.indexOf("TIMESTAMP") != -1 && (value != null && value.equals(GlobalConfig.getParameter("SYSDATE")))) {
+                pst.setTimestamp(a+1,new java.sql.Timestamp(System.currentTimeMillis()));
 		} else if (type.indexOf("TIMESTAMP") != -1 && (value == null || !value.equals(GlobalConfig.getParameter("SYSDATE")))) {
 		if (value == null) {
diff -rNBwU 2 ../open-xchange-0.8.2-origin/system/setup/create_mysql_database.sql.in ./system/setup/create_mysql_database.sql.in
--- ../open-xchange-0.8.2-origin/system/setup/create_mysql_database.sql.in	1970-01-01 01:00:00.000000000 +0100
+++ ./system/setup/create_mysql_database.sql.in	2006-05-04 23:01:37.636099432 +0200
@@ -0,0 +1,117 @@
+DROP DATABASE IF EXISTS @dbname@;
+
+CREATE DATABASE @dbname@ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+GRANT ALL PRIVILEGES ON @dbname@.* TO '@dbuser@'@'localhost' IDENTIFIED BY '@dbpass@' WITH GRANT OPTION;
+GRANT ALL PRIVILEGES ON @dbname@.* TO '@dbuser@'@'%' IDENTIFIED BY '@dbpass@';
+
+USE @dbname@;
+
+DROP TABLE IF EXISTS table_fid;
+
+CREATE TABLE table_fid (
+        id INT  NOT NULL AUTO_INCREMENT,
+        primary key (id)
+);
+
+DROP FUNCTION IF EXISTS select_fid;
+
+DELIMITER //
+
+CREATE FUNCTION select_fid () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
+BEGIN
+  DECLARE xid INT;
+  INSERT into table_fid VALUES();
+  SELECT last_insert_id() into xid;
+  RETURN xid;
+END //
+
+DELIMITER ;
+
+DROP TABLE IF EXISTS table_serial_id;
+
+CREATE TABLE table_serial_id (
+        id INT  NOT NULL AUTO_INCREMENT,
+        primary key (id)
+) AUTO_INCREMENT = 10;
+
+DROP FUNCTION IF EXISTS select_serial_id;
+
+DELIMITER //
+
+CREATE FUNCTION select_serial_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
+BEGIN
+  DECLARE xid INT;
+  INSERT into table_serial_id VALUES();
+  SELECT last_insert_id() into xid;
+  RETURN xid;
+END //
+
+DELIMITER ;
+
+
+DROP TABLE IF EXISTS table_import_id;
+
+CREATE TABLE table_import_id (
+        id INT  NOT NULL AUTO_INCREMENT,
+        primary key (id)
+);
+
+DROP FUNCTION IF EXISTS select_import_id;
+
+DELIMITER //
+
+CREATE FUNCTION select_import_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
+BEGIN
+  DECLARE xid INT;
+  INSERT into table_import_id VALUES();
+  SELECT last_insert_id() into xid;
+  RETURN xid;
+END //
+
+DELIMITER ;
+
+
+DROP TABLE IF EXISTS table_insert_id;
+
+CREATE TABLE table_insert_id (
+        id INT  NOT NULL AUTO_INCREMENT,
+        primary key (id)
+) AUTO_INCREMENT = 101;
+
+DROP FUNCTION IF EXISTS select_insert_id;
+
+DELIMITER //
+
+CREATE FUNCTION select_insert_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
+BEGIN
+  DECLARE xid INT;
+  INSERT into table_insert_id VALUES();
+  SELECT last_insert_id() into xid;
+  RETURN xid;
+END //
+
+DELIMITER ;
+
+DROP TABLE IF EXISTS table_profile_id;
+
+CREATE TABLE table_profile_id (
+        id INT  NOT NULL AUTO_INCREMENT,
+        primary key (id)
+);
+
+DROP FUNCTION IF EXISTS select_profile_id;
+
+DELIMITER //
+
+CREATE FUNCTION select_profile_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
+BEGIN
+  DECLARE xid INT;
+  INSERT into table_profile_id VALUES();
+  SELECT last_insert_id() into xid;
+  RETURN xid;
+END //
+
+
+DELIMITER ;
+
diff -rNBwU 2 ../open-xchange-0.8.2-origin/system/setup/init_mysql_database.sql ./system/setup/init_mysql_database.sql
--- ../open-xchange-0.8.2-origin/system/setup/init_mysql_database.sql	2006-04-25 10:57:34.000000000 +0200
+++ ./system/setup/init_mysql_database.sql	2006-05-04 23:01:37.640098824 +0200
@@ -1,110 +1,12 @@
  
-DROP TABLE IF EXISTS table_fid;
 
-CREATE TABLE table_fid (
-	id INT  NOT NULL AUTO_INCREMENT,
-	primary key (id)
-);
-
-DROP FUNCTION IF EXISTS select_fid;
-
-DELIMITER //
-
-CREATE FUNCTION select_fid () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
-BEGIN
-  DECLARE xid INT;
-  INSERT into table_fid VALUES();
-  SELECT last_insert_id() into xid;
-  RETURN xid;
-END //
-
-DELIMITER ;
- 
-DROP TABLE IF EXISTS table_serial_id;
-
-CREATE TABLE table_serial_id (
-	id INT  NOT NULL AUTO_INCREMENT,
-	primary key (id)
-) AUTO_INCREMENT = 9;
-
-DROP FUNCTION IF EXISTS select_serial_id;
-
-DELIMITER //
-
-CREATE FUNCTION select_serial_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
-BEGIN
-  DECLARE xid INT;
-  INSERT into table_serial_id VALUES();
-  SELECT last_insert_id() into xid;
-  RETURN xid;
-END //
-
-DELIMITER ;
-
- 
-DROP TABLE IF EXISTS table_import_id;
-
-CREATE TABLE table_import_id (
-	id INT  NOT NULL AUTO_INCREMENT,
-	primary key (id)
-);
 
-DROP FUNCTION IF EXISTS select_import_id;
 
-DELIMITER //
 
-CREATE FUNCTION select_import_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
-BEGIN
-  DECLARE xid INT;
-  INSERT into table_import_id VALUES();
-  SELECT last_insert_id() into xid;
-  RETURN xid;
-END //
 
-DELIMITER ;
 
  
-DROP TABLE IF EXISTS table_insert_id;
 
-CREATE TABLE table_insert_id (
-	id INT  NOT NULL AUTO_INCREMENT,
-	primary key (id)
-) AUTO_INCREMENT = 101;
 
-DROP FUNCTION IF EXISTS select_insert_id;
-
-DELIMITER //
-
-CREATE FUNCTION select_insert_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
-BEGIN
-  DECLARE xid INT;
-  INSERT into table_insert_id VALUES();
-  SELECT last_insert_id() into xid;
-  RETURN xid;
-END //
-
-DELIMITER ;
-
-DROP TABLE IF EXISTS table_profile_id;
-
-CREATE TABLE table_profile_id (
-	id INT  NOT NULL AUTO_INCREMENT,
-	primary key (id)
-);
-
-DROP FUNCTION IF EXISTS select_profile_id;
-
-DELIMITER //
-
-CREATE FUNCTION select_profile_id () RETURNS INTEGER DETERMINISTIC MODIFIES SQL DATA
-BEGIN
-  DECLARE xid INT;
-  INSERT into table_profile_id VALUES();
-  SELECT last_insert_id() into xid;
-  RETURN xid;
-END //
-
-
-DELIMITER ;
 
 CREATE TABLE prg_dlist (
@@ -309,5 +211,5 @@
 	changing_date timestamp ,
 	changed_from text,
-	login text PRIMARY KEY,
+	login varchar(255) PRIMARY KEY,
 	addr_u text,
 	addr_r text,
@@ -446,5 +348,5 @@
 	timestampfield01 timestamp ,
 	timestampfield02 timestamp ,
-	intfield01 int NOT NULL,
+	intfield01 int PRIMARY KEY,
 	intfield02 int,
 	intfield03 int,
@@ -1328,5 +1230,35 @@
 	timestampfield01 timestamp ,
 	timestampfield02 timestamp ,
-	intfield01 int NOT NULL,
+	intfield01 int PRIMARY KEY,
+	intfield02 int,
+	intfield03 int,
+	intfield04 int,
+	intfield05 int,
+	intfield06 int,
+	field01 text NOT NULL,
+	field02 text,
+	field03 text,
+	field04 text,
+	field05 text,
+	field06 text,
+	field07 text,
+	field08 text,
+	field09 text,
+	field10 text
+);
+
+CREATE TABLE del_docufolders (
+	creating_date timestamp NOT NULL,
+	created_from text NOT NULL,
+	changing_date timestamp,
+	changed_from text,
+	user_right text NOT NULL,
+	group_right text NOT NULL,
+	sid text NOT NULL,
+	tid text,
+	order_crit text,
+	timestampfield01 timestamp,
+	timestampfield02 timestamp,
+	intfield01 int PRIMARY KEY,
 	intfield02 int,
 	intfield03 int,
@@ -1358,5 +1290,35 @@
 	timestampfield01 timestamp ,
 	timestampfield02 timestamp ,
-	intfield01 int NOT NULL,
+	intfield01 int PRIMARY KEY,
+	intfield02 int NOT NULL,
+	intfield03 int,
+	intfield04 int,
+	intfield05 int,
+	intfield06 int,
+	field01 text NOT NULL,
+	field02 text,
+	field03 text,
+	field04 text,
+	field05 text,
+	field06 text,
+	field07 text,
+	field08 text,
+	field09 text,
+	field10 text
+);
+
+CREATE TABLE del_documents (
+	creating_date timestamp NOT NULL,
+	created_from text NOT NULL,
+	changing_date timestamp,
+	changed_from text,
+	user_right text NOT NULL,
+	group_right text NOT NULL,
+	sid text NOT NULL,
+	tid text,
+	order_crit text,
+	timestampfield01 timestamp,
+	timestampfield02 timestamp,
+	intfield01 int PRIMARY KEY,
 	intfield02 int NOT NULL,
 	intfield03 int,
@@ -1388,5 +1350,35 @@
 	timestampfield01 timestamp ,
 	timestampfield02 timestamp ,
-	intfield01 int NOT NULL,
+	intfield01 int PRIMARY KEY,
+	intfield02 int NOT NULL,
+	intfield03 int NOT NULL,
+	intfield04 int,
+	intfield05 int,
+	intfield06 int,
+	field01 text NOT NULL,
+	field02 text,
+	field03 text NOT NULL,
+	field04 text NOT NULL,
+	field05 text,
+	field06 text,
+	field07 text,
+	field08 text,
+	field09 text,
+	field10 text
+);
+
+CREATE TABLE del_documents_files (
+	creating_date timestamp NOT NULL,
+	created_from text,
+	changing_date timestamp,
+	changed_from text,
+	user_right text,
+	group_right text,
+	sid text NOT NULL,
+	tid text,
+	order_crit text,
+	timestampfield01 timestamp,
+	timestampfield02 timestamp,
+	intfield01 int PRIMARY KEY,
 	intfield02 int NOT NULL,
 	intfield03 int NOT NULL,
@@ -1972,5 +1964,5 @@
 CREATE TABLE sys_linkage (
 	changing_date timestamp  NOT NULL,
-	luid int NOT NULL,
+	luid int PRIMARY KEY,
 	source_id int NOT NULL,
 	src_table text NOT NULL,
@@ -1992,5 +1984,5 @@
 CREATE TABLE del_linkage (
 	changing_date timestamp  NOT NULL,
-	luid int NOT NULL,
+	luid int PRIMARY KEY,
 	source_id int NOT NULL,
 	src_table text NOT NULL,
@@ -2046,4 +2038,10 @@
 );
 
+CREATE TABLE oxfolder_userfolders_standardfolders (
+        owner text,
+        module text,
+        fuid int
+);
+
 CREATE TABLE del_oxfolder_tree (
         fuid int,
@@ -2110,4 +2108,10 @@
 );
 
+CREATE TABLE del_system_objects (
+		object_type int,
+		object_id text,
+		deleting_date timestamp
+);
+
 INSERT INTO oxfolder_tree VALUES (1, 0, 'private', 'system', 'system','system', 'system', now(), 'System', null, null);
 INSERT INTO oxfolder_tree VALUES (2, 0, 'public', 'system', 'system','system', 'system', now(), 'System', null, null);
@@ -2127,4 +2131,5 @@
 INSERT INTO oxfolder_permissions VALUES (select_serial_id(), 7, 512, 'all_ox_users_and_ox_groups', 0, 2, 0, 0, 0);
 INSERT INTO oxfolder_permissions VALUES (select_serial_id(), 8, 512, 'all_ox_users_and_ox_groups', 0, 8, 4, 2, 2);
+INSERT INTO oxfolder_permissions VALUES (select_serial_id(), 9, 32768, 'mailadmin', 0, 128, 128, 128, 128);
 
 INSERT INTO oxfolder_specialfolders VALUES ('private', 1);