--- open-xchange-0.8.2.orig/conf/admintools.conf.in 2006-04-25 10:57:34.000000000 +0200 +++ open-xchange-0.8.2.orig/conf/admintools.conf.in 2006-05-19 15:07:15.000000000 +0200 @@ -68,7 +68,7 @@ DEFAULT_SQL_USER="@dbuser@" DEFAULT_SQL_PASS="@dbpass@" ### if u want to use mysql change to mysql -SQL_DB_TYPE="pgsql" +SQL_DB_TYPE="mysql" # Default Table where we store the Rights --- open-xchange-0.8.2.orig/conf/groupware/intranet.conf 2006-04-25 10:57:34.000000000 +0200 +++ open-xchange-0.8.2.orig/conf/groupware/intranet.conf 2006-05-19 15:07:15.000000000 +0200 @@ -129,18 +129,26 @@ # direct_link_hostname=server # 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" #seq-import_id=SELECT import_id.nextval --- open-xchange-0.8.2.orig/configure.in 2006-04-25 10:57:34.000000000 +0200 +++ open-xchange-0.8.2.orig/configure.in 2006-05-19 15:07:15.000000000 +0200 @@ -791,6 +791,7 @@ conf/webmail/system.properties conf/admintools.conf system/setup/init_ldap.ldif +system/setup/create_mysql_database.sql src/com/openexchange/server/Version.java ) dnl here we should be able to build the complete ox solution ... --- open-xchange-0.8.2.orig/system/setup/create_mysql_database.sql.in 1970-01-01 01:00:00.000000000 +0100 +++ open-xchange-0.8.2.orig/system/setup/create_mysql_database.sql.in 2006-05-19 15:10:31.000000000 +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 = 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 ; + --- open-xchange-0.8.2.orig/system/setup/init_mysql_database.sql 2006-04-25 10:57:34.000000000 +0200 +++ open-xchange-0.8.2.orig/system/setup/init_mysql_database.sql 2006-05-19 15:07:15.000000000 +0200 @@ -1,112 +1,3 @@ - -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 ( intfield01 integer, intfield02 integer, @@ -445,7 +336,7 @@ order_crit text, timestampfield01 timestamp , timestampfield02 timestamp , - intfield01 int NOT NULL, + intfield01 int PRIMARY KEY, intfield02 int, intfield03 int, intfield04 int, @@ -1126,7 +1017,7 @@ CREATE TABLE projects_notes ( intfield01 integer, - note_id VARCHAR (255), + note_id VARCHAR(166), member_id text, primary key (intfield01, note_id), foreign key (intfield01) references projects on delete cascade on update cascade @@ -1134,7 +1025,7 @@ CREATE TABLE backup_projects_notes ( intfield01 integer, - note_id VARCHAR (255), + note_id VARCHAR(166), member_id text, primary key (intfield01, note_id), foreign key (intfield01) references backup_projects on delete cascade on update cascade @@ -1177,7 +1068,7 @@ CREATE TABLE projects_antecessors ( intfield01 integer, id integer, - antecessor VARCHAR (255), + antecessor VARCHAR(166), object_type integer, primary key (intfield01, id, antecessor), foreign key (intfield01, id) references projects_dependencies on delete cascade on update cascade @@ -1186,7 +1077,7 @@ CREATE TABLE backup_projects_antecessors ( intfield01 integer, id integer, - antecessor VARCHAR (255), + antecessor VARCHAR(166), object_type integer, primary key (intfield01, id, antecessor), foreign key (intfield01, id) references backup_projects_dependencies on delete cascade on update cascade @@ -1327,7 +1218,37 @@ order_crit text, 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, intfield04 int, @@ -1357,7 +1280,37 @@ order_crit text, 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, intfield04 int, @@ -1387,7 +1340,37 @@ order_crit text, 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, intfield04 int, @@ -1971,7 +1954,7 @@ 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, src_field text NOT NULL, @@ -1991,7 +1974,7 @@ 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, src_field text NOT NULL, @@ -2045,6 +2028,12 @@ img text ); +CREATE TABLE oxfolder_userfolders_standardfolders ( + owner text, + module text, + fuid int +); + CREATE TABLE del_oxfolder_tree ( fuid int, parent int, @@ -2109,14 +2098,20 @@ target_object_id int ); -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); -INSERT INTO oxfolder_tree VALUES (3, 0, 'shared', 'system', 'system','system', 'system', now(), 'System', null, null); -INSERT INTO oxfolder_tree VALUES (4, 0, 'system', 'system', 'system','system', 'system', now(), 'System', null, null); -INSERT INTO oxfolder_tree VALUES (5, 4, 'system_global', 'contact', 'system','system', 'system', now(), 'System', null, null); -INSERT INTO oxfolder_tree VALUES (6, 4, 'system_ldap', 'contact', 'system','system', 'system', now(), 'System', null, null); -INSERT INTO oxfolder_tree VALUES (7, 0, 'user', 'system', 'system','system', 'system', now(), 'System', null, null); -INSERT INTO oxfolder_tree VALUES (8, 7, 'projects', 'projects', 'system','system', 'system', now(), 'System', null, null); +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); +INSERT INTO oxfolder_tree VALUES (3, 0, 'shared', 'system', 'system','system', 'system', 'now', 'System', null, null); +INSERT INTO oxfolder_tree VALUES (4, 0, 'system', 'system', 'system','system', 'system', 'now', 'System', null, null); +INSERT INTO oxfolder_tree VALUES (5, 4, 'system_global', 'contact', 'system','system', 'system', 'now', 'System', null, null); +INSERT INTO oxfolder_tree VALUES (6, 4, 'system_ldap', 'contact', 'system','system', 'system', 'now', 'System', null, null); +INSERT INTO oxfolder_tree VALUES (7, 0, 'user', 'system', 'system','system', 'system', 'now', 'System', null, null); +INSERT INTO oxfolder_tree VALUES (8, 7, 'projects', 'projects', 'system','system', 'system', 'now', 'System', null, null); INSERT INTO oxfolder_permissions VALUES (select_serial_id(), 1, 512,'all_ox_users_and_ox_groups', 0, 8, 0, 0, 0); INSERT INTO oxfolder_permissions VALUES (select_serial_id(), 2, 512, 'all_ox_users_and_ox_groups', 0, 8, 0, 0, 0);