mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-25 23:09:29 +00:00
see ChangeLog
Monotone-Revision: 9054022ef1ca8aeba6e34842d27d9b94ce002b89 Monotone-Author: dev-unix.inverse.qc.ca Monotone-Date: 2006-06-15T19:34:10 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
39
OGoContentStore/sql/README
Normal file
39
OGoContentStore/sql/README
Normal file
@@ -0,0 +1,39 @@
|
||||
Files
|
||||
=====
|
||||
|
||||
appointment-create.psql
|
||||
- this is a template for creating appointment quick/blob tables
|
||||
- not used by code atm
|
||||
|
||||
folderinfo-create.psql
|
||||
- create folder info table (folder registry table)
|
||||
- insert some folders per default:
|
||||
- /Users
|
||||
- /Users/helge
|
||||
- /Users/helge/Calendar
|
||||
|
||||
foldertablecreate-root.psql
|
||||
- insert "/" and "/Users" parent folders (without storage, quick and type)
|
||||
|
||||
foldertablecreate-helge-privcal.psql
|
||||
- create a quick and content table for 'helge/Calendar' folder
|
||||
|
||||
register-agenor-helge-privcal.psql
|
||||
- register folder "/Users/helge/Calendar" folder in the registry table with
|
||||
a link to the proper quick and content tables
|
||||
|
||||
testapt-agenor-helge-privcal.psql
|
||||
- insert a raw iCalendar test appointment in the /Users/helge/Calendar
|
||||
folder quick and content tables
|
||||
|
||||
|
||||
Notes
|
||||
=====
|
||||
|
||||
Listing the folders of a certain user:
|
||||
|
||||
sqlite> SELECT c_path FROM SOGo_folder_info \
|
||||
WHERE c_path2 = 'test.et.di.cete-lyon';
|
||||
/Users/test.et.di.cete-lyon
|
||||
/Users/test.et.di.cete-lyon/Calendar
|
||||
/Users/test.et.di.cete-lyon/Contacts
|
||||
30
OGoContentStore/sql/appointment-create.psql
Normal file
30
OGoContentStore/sql/appointment-create.psql
Normal file
@@ -0,0 +1,30 @@
|
||||
--
|
||||
-- (C) 2004-2005 SKYRIX Software AG
|
||||
--
|
||||
|
||||
CREATE TABLE %s_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
uid VARCHAR(256) NOT NULL,
|
||||
startdate INT NOT NULL,
|
||||
enddate INT NOT NULL,
|
||||
title VARCHAR(1000) NOT NULL,
|
||||
participants VARCHAR(100000) NOT NULL, -- the CNs of the participants
|
||||
isallday INT NULL,
|
||||
iscycle INT NULL, -- client needs to fetch to resolve
|
||||
ispublic INT NOT NULL,
|
||||
status INT NOT NULL,
|
||||
isopaque INT NULL,
|
||||
location VARCHAR(256) NULL,
|
||||
orgmail VARCHAR(256) NULL,
|
||||
partmails VARCHAR(100000) NOT NULL, -- the emails of the participants
|
||||
partstates VARCHAR(256) NOT NULL, -- the status of each participant
|
||||
sequence INT NULL -- the iCal sequence
|
||||
);
|
||||
|
||||
CREATE TABLE %s_blob (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
c_content VARCHAR(100000) NOT NULL, -- the BLOB
|
||||
c_creationdate INT NOT NULL, -- creation date
|
||||
c_lastmodified INT NOT NULL, -- last modification (UPDATE)
|
||||
c_version INT NOT NULL, -- version counter
|
||||
);
|
||||
67
OGoContentStore/sql/folderinfo-create.psql
Normal file
67
OGoContentStore/sql/folderinfo-create.psql
Normal file
@@ -0,0 +1,67 @@
|
||||
--
|
||||
-- (C) 2004-2005 SKYRIX Software AG
|
||||
--
|
||||
-- TODO:
|
||||
-- add a unique constraints on path
|
||||
|
||||
CREATE SEQUENCE SOGo_folder_info_seq;
|
||||
|
||||
DROP TABLE SOGo_folder_info;
|
||||
|
||||
CREATE TABLE SOGo_folder_info (
|
||||
c_folder_id INTEGER
|
||||
DEFAULT nextval('SOGo_folder_info_seq')
|
||||
NOT NULL
|
||||
PRIMARY KEY, -- the primary key
|
||||
c_path VARCHAR(255) NOT NULL, -- the full path to the folder
|
||||
c_path1 VARCHAR(255) NOT NULL, -- parts (for fast queries)
|
||||
c_path2 VARCHAR(255) NULL, -- parts (for fast queries)
|
||||
c_path3 VARCHAR(255) NULL, -- parts (for fast queries)
|
||||
c_path4 VARCHAR(255) NULL, -- parts (for fast queries)
|
||||
c_foldername VARCHAR(255) NOT NULL, -- last path component
|
||||
c_location VARCHAR(2048) NOT NULL, -- URL to folder
|
||||
c_quick_location VARCHAR(2048) NULL, -- URL to quicktable of folder
|
||||
c_folder_type VARCHAR(255) NOT NULL -- the folder type ...
|
||||
);
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users',
|
||||
'Users',
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
'Users',
|
||||
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder',
|
||||
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/helge',
|
||||
'Users',
|
||||
'helge',
|
||||
NULL,
|
||||
NULL,
|
||||
'helge',
|
||||
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder',
|
||||
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/helge/Calendar',
|
||||
'Users',
|
||||
'helge',
|
||||
'Calendar',
|
||||
NULL,
|
||||
'Calendar',
|
||||
'http://OGo:OGo@localhost:5432/OGo/SOGo_helge_privcal',
|
||||
'http://OGo:OGo@localhost:5432/OGo/SOGo_helge_privcal_quick',
|
||||
'Appointment' );
|
||||
62
OGoContentStore/sql/folderinfo-create.sqlite
Normal file
62
OGoContentStore/sql/folderinfo-create.sqlite
Normal file
@@ -0,0 +1,62 @@
|
||||
--
|
||||
-- (C) 2005 SKYRIX Software AG
|
||||
--
|
||||
-- TODO:
|
||||
-- add a unique constraints on path
|
||||
|
||||
-- DROP TABLE SOGo_folder_info;
|
||||
|
||||
CREATE TABLE SOGo_folder_info (
|
||||
c_folder_id INTEGER PRIMARY KEY,
|
||||
c_path VARCHAR(255) NOT NULL, /* the full path to the folder */
|
||||
c_path1 VARCHAR(255) NOT NULL, /* parts (for fast queries) */
|
||||
c_path2 VARCHAR(255) NULL, /* parts (for fast queries) */
|
||||
c_path3 VARCHAR(255) NULL, /* parts (for fast queries) */
|
||||
c_path4 VARCHAR(255) NULL, /* parts (for fast queries) */
|
||||
c_foldername VARCHAR(255) NOT NULL, /* last path component */
|
||||
c_location VARCHAR(2048) NOT NULL, /* URL to folder */
|
||||
c_quick_location VARCHAR(2048) NULL, /* URL to quicktable of folder */
|
||||
c_folder_type VARCHAR(255) NOT NULL /* the folder type ... */
|
||||
);
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users',
|
||||
'Users',
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
'Users',
|
||||
'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_blob',
|
||||
'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/helge',
|
||||
'Users',
|
||||
'helge',
|
||||
NULL,
|
||||
NULL,
|
||||
'helge',
|
||||
'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_blob',
|
||||
'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/helge/Calendar',
|
||||
'Users',
|
||||
'helge',
|
||||
'Calendar',
|
||||
NULL,
|
||||
'Calendar',
|
||||
'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_helge_privcal_blob',
|
||||
'sqlite://localhost/tmp/sogo-registry.sqlite/SOGo_helge_privcal_quick',
|
||||
'Appointment' );
|
||||
35
OGoContentStore/sql/foldertablecreate-helge-privcal.psql
Normal file
35
OGoContentStore/sql/foldertablecreate-helge-privcal.psql
Normal file
@@ -0,0 +1,35 @@
|
||||
--
|
||||
-- (C) 2004 SKYRIX Software AG
|
||||
--
|
||||
|
||||
DROP TABLE SOGo_helge_privcal_quick;
|
||||
DROP TABLE SOGo_helge_privcal;
|
||||
|
||||
CREATE TABLE SOGo_helge_privcal_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
uid VARCHAR(256) NOT NULL,
|
||||
startdate INT NOT NULL,
|
||||
enddate INT NOT NULL,
|
||||
cycleenddate INT NULL, -- enddate for cyclic events
|
||||
title VARCHAR(1000) NOT NULL,
|
||||
cycleinfo VARCHAR(1000) NULL, -- property list with cycle infos
|
||||
participants VARCHAR(100000) NOT NULL, -- the CNs of the participants
|
||||
isallday INT NULL,
|
||||
iscycle INT NULL, -- client needs to fetch to resolve
|
||||
ispublic INT NOT NULL,
|
||||
status INT NOT NULL,
|
||||
isopaque INT NULL,
|
||||
location VARCHAR(256) NULL,
|
||||
orgmail VARCHAR(256) NULL,
|
||||
partmails VARCHAR(100000) NOT NULL, -- the emails of the participants
|
||||
partstates VARCHAR(256) NOT NULL, -- the status of each participant
|
||||
sequence INT NULL -- the iCal sequence
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_helge_privcal (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
c_content VARCHAR(100000) NOT NULL, -- the BLOB
|
||||
c_creationdate INT NOT NULL, -- creation date
|
||||
c_lastmodified INT NOT NULL, -- last modification (UPDATE)
|
||||
c_version INT NOT NULL -- version counter
|
||||
);
|
||||
36
OGoContentStore/sql/foldertablecreate-helge-privcal.sqlite
Normal file
36
OGoContentStore/sql/foldertablecreate-helge-privcal.sqlite
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
(C) 2005 SKYRIX Software AG
|
||||
*/
|
||||
|
||||
DROP TABLE SOGo_helge_privcal_quick;
|
||||
DROP TABLE SOGo_helge_privcal;
|
||||
|
||||
CREATE TABLE SOGo_helge_privcal_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
uid VARCHAR(256) NOT NULL,
|
||||
startdate INT NOT NULL,
|
||||
enddate INT NOT NULL,
|
||||
cycleenddate INT NULL, /* enddate for cyclic events */
|
||||
title VARCHAR(1000) NOT NULL,
|
||||
cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */
|
||||
participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */
|
||||
isallday INT NULL,
|
||||
iscycle INT NULL, /* client needs to fetch to resolve */
|
||||
ispublic INT NOT NULL,
|
||||
status INT NOT NULL,
|
||||
isopaque INT NULL,
|
||||
priority INT NOT NULL, -- for marking high prio apts
|
||||
location VARCHAR(256) NULL,
|
||||
orgmail VARCHAR(256) NULL,
|
||||
partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */
|
||||
partstates VARCHAR(256) NOT NULL, /* the status of each participant */
|
||||
sequence INT NULL /* the iCal sequence */
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_helge_privcal_blob (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
c_content VARCHAR(100000) NOT NULL, /* the BLOB */
|
||||
c_creationdate INT NOT NULL, /* creation date */
|
||||
c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
|
||||
c_version INT NOT NULL /* version counter */
|
||||
);
|
||||
9
OGoContentStore/sql/foldertablecreate-root.psql
Normal file
9
OGoContentStore/sql/foldertablecreate-root.psql
Normal file
@@ -0,0 +1,9 @@
|
||||
# $Id$
|
||||
|
||||
INSERT INTO sogo_folder_info
|
||||
(c_path,c_path1,c_path2,c_path3,c_path4,c_foldername,c_location,c_folder_type)
|
||||
VALUES ('/', '', NULL, NULL, NULL, '', '', 'Container');
|
||||
|
||||
INSERT INTO sogo_folder_info
|
||||
(c_path,c_path1,c_path2,c_path3,c_path4,c_foldername,c_location,c_folder_type)
|
||||
VALUES ('/Users', 'Users', NULL, NULL, NULL, 'Users', '', 'Container');
|
||||
27
OGoContentStore/sql/foldertablecreate-test-contacts.psql
Normal file
27
OGoContentStore/sql/foldertablecreate-test-contacts.psql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- $Id$
|
||||
--
|
||||
-- (C) 2004 SKYRIX Software AG
|
||||
--
|
||||
|
||||
DROP TABLE SOGo_test_contacts_quick;
|
||||
DROP TABLE SOGo_test_contacts_blob;
|
||||
|
||||
CREATE TABLE SOGo_test_contacts_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
givenname VARCHAR(256),
|
||||
cn VARCHAR(256),
|
||||
sn VARCHAR(256),
|
||||
l VARCHAR(256),
|
||||
mail VARCHAR(256),
|
||||
o VARCHAR(256),
|
||||
ou VARCHAR(256),
|
||||
telephonenumber VARCHAR(256)
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_test_contacts_blob (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
c_content VARCHAR(100000) NOT NULL, -- the BLOB
|
||||
c_creationdate INT NOT NULL, -- creation date
|
||||
c_lastmodified INT NOT NULL, -- last modification (UPDATE)
|
||||
c_version INT NOT NULL -- version counter
|
||||
);
|
||||
114
OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite.sh
Executable file
114
OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite.sh
Executable file
@@ -0,0 +1,114 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...]
|
||||
#
|
||||
|
||||
DB="/tmp/sogo-registry.sqlite"
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
USER_ID=$1
|
||||
USER_TABLE=`echo $USER_ID | tr -s [:punct:] _`
|
||||
cat << EOF
|
||||
DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}';
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
NULL,
|
||||
NULL,
|
||||
'${USER_ID}',
|
||||
'sqlite://localhost${DB}/SOGo_user_folder_blob',
|
||||
'sqlite://localhost${DB}/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}/Calendar',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
'Calendar',
|
||||
NULL,
|
||||
'Calendar',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal_blob',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal_quick',
|
||||
'Appointment' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}/Contacts',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
'Contacts',
|
||||
NULL,
|
||||
'Contacts',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts_blob',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts_quick',
|
||||
'Contact' );
|
||||
|
||||
DROP TABLE SOGo_${USER_TABLE}_privcal_quick;
|
||||
DROP TABLE SOGo_${USER_TABLE}_privcal_blob;
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_privcal_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
uid VARCHAR(256) NOT NULL,
|
||||
startdate INT NOT NULL,
|
||||
enddate INT NOT NULL,
|
||||
cycleenddate INT NULL, /* enddate for cyclic events */
|
||||
title VARCHAR(1000) NOT NULL,
|
||||
cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */
|
||||
participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */
|
||||
isallday INT NULL,
|
||||
iscycle INT NULL, /* client needs to fetch to resolve */
|
||||
ispublic INT NOT NULL,
|
||||
status INT NOT NULL,
|
||||
isopaque INT NULL,
|
||||
priority INT NOT NULL, -- for marking high prio apts
|
||||
location VARCHAR(256) NULL,
|
||||
orgmail VARCHAR(256) NULL,
|
||||
partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */
|
||||
partstates VARCHAR(256) NOT NULL, /* the status of each participant */
|
||||
sequence INT NULL /* the iCal sequence */
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_privcal_blob (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
c_content VARCHAR(100000) NOT NULL, /* the BLOB */
|
||||
c_creationdate INT NOT NULL, /* creation date */
|
||||
c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
|
||||
c_version INT NOT NULL /* version counter */
|
||||
);
|
||||
|
||||
DROP TABLE SOGo_${USER_TABLE}_contacts_quick;
|
||||
DROP TABLE SOGo_${USER_TABLE}_contacts_blob;
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_contacts_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
givenname VARCHAR(256),
|
||||
cn VARCHAR(256),
|
||||
sn VARCHAR(256),
|
||||
l VARCHAR(256),
|
||||
mail VARCHAR(256),
|
||||
o VARCHAR(256),
|
||||
ou VARCHAR(256),
|
||||
telephonenumber VARCHAR(256)
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_contacts_blob (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
c_content VARCHAR(100000) NOT NULL, /* the BLOB */
|
||||
c_creationdate INT NOT NULL, /* creation date */
|
||||
c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
|
||||
c_version INT NOT NULL /* version counter */
|
||||
);
|
||||
|
||||
EOF
|
||||
shift
|
||||
done
|
||||
109
OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite1table.sh
Executable file
109
OGoContentStore/sql/generate-folderinfo-sql-for-users-sqlite1table.sh
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...]
|
||||
#
|
||||
|
||||
DB="/tmp/sogo-registry.sqlite"
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
USER_ID=$1
|
||||
USER_TABLE=`echo $USER_ID | tr -s [:punct:] _`
|
||||
|
||||
cat << EOF
|
||||
DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}';
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
NULL,
|
||||
NULL,
|
||||
'${USER_ID}',
|
||||
'sqlite://localhost${DB}/SOGo_user_folder_blob',
|
||||
'sqlite://localhost${DB}/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}/Calendar',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
'Calendar',
|
||||
NULL,
|
||||
'Calendar',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal',
|
||||
'Appointment' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}/Contacts',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
'Contacts',
|
||||
NULL,
|
||||
'Contacts',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts',
|
||||
'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts',
|
||||
'Contact' );
|
||||
|
||||
|
||||
DROP TABLE SOGo_${USER_TABLE}_privcal;
|
||||
CREATE TABLE SOGo_${USER_TABLE}_privcal (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
c_content VARCHAR(100000) NOT NULL, /* the BLOB */
|
||||
c_creationdate INT NOT NULL, /* creation date */
|
||||
c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
|
||||
c_version INT NOT NULL, /* version counter */
|
||||
|
||||
/* quick fields */
|
||||
uid VARCHAR(256) NOT NULL,
|
||||
startdate INT NOT NULL,
|
||||
enddate INT NOT NULL,
|
||||
cycleenddate INT NULL, /* enddate for cyclic events */
|
||||
title VARCHAR(1000) NOT NULL,
|
||||
cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */
|
||||
participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */
|
||||
isallday INT NULL,
|
||||
iscycle INT NULL, /* client needs to fetch to resolve */
|
||||
ispublic INT NOT NULL,
|
||||
status INT NOT NULL,
|
||||
priority INT NOT NULL, -- for marking high prio apts
|
||||
isopaque INT NULL,
|
||||
location VARCHAR(256) NULL,
|
||||
orgmail VARCHAR(256) NULL,
|
||||
partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */
|
||||
partstates VARCHAR(256) NOT NULL, /* the status of each participant */
|
||||
sequence INT NULL /* the iCal sequence */
|
||||
);
|
||||
|
||||
|
||||
DROP TABLE SOGo_${USER_TABLE}_contacts;
|
||||
CREATE TABLE SOGo_${USER_TABLE}_contacts (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
|
||||
c_content VARCHAR(100000) NOT NULL, /* the BLOB */
|
||||
c_creationdate INT NOT NULL, /* creation date */
|
||||
c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
|
||||
c_version INT NOT NULL, /* version counter */
|
||||
|
||||
/* quick fields */
|
||||
givenname VARCHAR(256),
|
||||
cn VARCHAR(256),
|
||||
sn VARCHAR(256),
|
||||
l VARCHAR(256),
|
||||
mail VARCHAR(256),
|
||||
o VARCHAR(256),
|
||||
ou VARCHAR(256),
|
||||
telephonenumber VARCHAR(256)
|
||||
);
|
||||
|
||||
EOF
|
||||
shift
|
||||
done
|
||||
125
OGoContentStore/sql/generate-folderinfo-sql-for-users.sh
Executable file
125
OGoContentStore/sql/generate-folderinfo-sql-for-users.sh
Executable file
@@ -0,0 +1,125 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...]
|
||||
#
|
||||
|
||||
DB_USER="postgres"
|
||||
DB_PASS=""
|
||||
DB_HOST="agenor-db"
|
||||
DB_PORT="5432"
|
||||
DB_NAME="test"
|
||||
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
USER_ID=$1
|
||||
USER_TABLE=`echo $USER_ID | tr -s [:punct:] _`
|
||||
cat << EOF
|
||||
--
|
||||
-- (C) 2004 SKYRIX Software AG
|
||||
--
|
||||
-- TODO:
|
||||
-- add a unique constraints on path
|
||||
|
||||
DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}';
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
NULL,
|
||||
NULL,
|
||||
'${USER_ID}',
|
||||
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_user_folder',
|
||||
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_user_folder_quick',
|
||||
'Container' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}/Calendar',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
'Calendar',
|
||||
NULL,
|
||||
'Calendar',
|
||||
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal',
|
||||
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal_quick',
|
||||
'Appointment' );
|
||||
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/${USER_ID}/Contacts',
|
||||
'Users',
|
||||
'${USER_ID}',
|
||||
'Contacts',
|
||||
NULL,
|
||||
'Contacts',
|
||||
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts',
|
||||
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_quick',
|
||||
'Contact' );
|
||||
|
||||
DROP TABLE SOGo_${USER_TABLE}_privcal_quick;
|
||||
DROP TABLE SOGo_${USER_TABLE}_privcal;
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_privcal_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
uid VARCHAR(256) NOT NULL,
|
||||
startdate INT NOT NULL,
|
||||
enddate INT NOT NULL,
|
||||
cycleenddate INT NULL, -- enddate for cyclic events
|
||||
title VARCHAR(1000) NOT NULL,
|
||||
cycleinfo VARCHAR(1000) NULL, -- property list with cycle infos
|
||||
participants VARCHAR(100000) NOT NULL, -- the CNs of the participants
|
||||
isallday INT NULL,
|
||||
iscycle INT NULL, -- client needs to fetch to resolve
|
||||
ispublic INT NOT NULL,
|
||||
status INT NOT NULL,
|
||||
priority INT NOT NULL, -- for marking high prio apts
|
||||
isopaque INT NULL,
|
||||
location VARCHAR(256) NULL,
|
||||
orgmail VARCHAR(256) NULL,
|
||||
partmails VARCHAR(100000) NOT NULL, -- the emails of the participants
|
||||
partstates VARCHAR(256) NOT NULL, -- the status of each participant
|
||||
sequence INT NULL -- the iCal sequence
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_privcal (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
c_content VARCHAR(100000) NOT NULL, -- the BLOB
|
||||
c_creationdate INT NOT NULL, -- creation date
|
||||
c_lastmodified INT NOT NULL, -- last modification (UPDATE)
|
||||
c_version INT NOT NULL -- version counter
|
||||
);
|
||||
|
||||
DROP TABLE SOGo_${USER_TABLE}_contacts_quick;
|
||||
DROP TABLE SOGo_${USER_TABLE}_contacts;
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_contacts_quick (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
givenname VARCHAR(256),
|
||||
cn VARCHAR(256),
|
||||
sn VARCHAR(256),
|
||||
l VARCHAR(256),
|
||||
mail VARCHAR(256),
|
||||
o VARCHAR(256),
|
||||
ou VARCHAR(256),
|
||||
telephonenumber VARCHAR(256)
|
||||
);
|
||||
|
||||
CREATE TABLE SOGo_${USER_TABLE}_contacts (
|
||||
c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename
|
||||
c_content VARCHAR(100000) NOT NULL, -- the BLOB
|
||||
c_creationdate INT NOT NULL, -- creation date
|
||||
c_lastmodified INT NOT NULL, -- last modification (UPDATE)
|
||||
c_version INT NOT NULL -- version counter
|
||||
);
|
||||
|
||||
EOF
|
||||
shift
|
||||
done
|
||||
9
OGoContentStore/sql/profile-create.psql
Normal file
9
OGoContentStore/sql/profile-create.psql
Normal file
@@ -0,0 +1,9 @@
|
||||
--
|
||||
-- (C) 2005 SKYRIX Software AG
|
||||
--
|
||||
|
||||
CREATE TABLE SOGo_user_profile (
|
||||
uid VARCHAR(255) NOT NULL PRIMARY KEY,
|
||||
allowinternet SMALLINT DEFAULT 0,
|
||||
timezonename VARCHAR(255) DEFAULT 'MET'
|
||||
);
|
||||
13
OGoContentStore/sql/register-agenor-helge-privcal.psql
Normal file
13
OGoContentStore/sql/register-agenor-helge-privcal.psql
Normal file
@@ -0,0 +1,13 @@
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/helge/Calendar',
|
||||
'Users',
|
||||
'helge',
|
||||
'Calendar',
|
||||
NULL,
|
||||
'Calendar',
|
||||
'http://postgres:@agenor-db:5432/test/SOGo_helge_privcal',
|
||||
'http://postgres:@agenor-db:5432/test/SOGo_helge_privcal_quick',
|
||||
'Appointment' );
|
||||
13
OGoContentStore/sql/register-agenor-test-contacts.psql
Normal file
13
OGoContentStore/sql/register-agenor-test-contacts.psql
Normal file
@@ -0,0 +1,13 @@
|
||||
INSERT INTO SOGo_folder_info
|
||||
( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
|
||||
c_location, c_quick_location, c_folder_type )
|
||||
VALUES
|
||||
( '/Users/test.et.di.cete-lyon/Contacts',
|
||||
'Users',
|
||||
'test.et.di.cete-lyon',
|
||||
'Contacts',
|
||||
NULL,
|
||||
'Contacts',
|
||||
'http://postgres:@agenor-db:5432/test/SOGo_test_contacts_blob',
|
||||
'http://postgres:@agenor-db:5432/test/SOGo_test_contacts_quick',
|
||||
'Contact' );
|
||||
57
OGoContentStore/sql/testapt-agenor-helge-privcal.psql
Normal file
57
OGoContentStore/sql/testapt-agenor-helge-privcal.psql
Normal file
@@ -0,0 +1,57 @@
|
||||
--
|
||||
-- (C) 2004 SKYRIX Software AG
|
||||
--
|
||||
|
||||
DELETE FROM SOGo_helge_privcal
|
||||
WHERE c_name = 'BD91C454-AA65-11D8-84CA-000D93C1A604';
|
||||
DELETE FROM SOGo_helge_privcal_quick
|
||||
WHERE c_name = 'BD91C454-AA65-11D8-84CA-000D93C1A604';
|
||||
|
||||
|
||||
|
||||
INSERT INTO SOGo_helge_privcal
|
||||
( c_name, c_creationdate, c_lastmodified, c_version, c_content )
|
||||
VALUES (
|
||||
'BD91C454-AA65-11D8-84CA-000D93C1A604',
|
||||
928383,
|
||||
928383,
|
||||
1,
|
||||
'BEGIN:VEVENT
|
||||
DURATION:PT1H
|
||||
ATTENDEE;CN="Elke Bethke";DIR="addressbook://B156F3F0-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:E.Bethke@Sachsen-Anhalt-Lotto.de
|
||||
ATTENDEE;CN="Erik Doernenburg";DIR="addressbook://B15FCB0F-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:erik@x101.net
|
||||
ATTENDEE;CN="Christian Schnelle";DIR="addressbook://B1418D4E-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:cs@enervation.de
|
||||
ATTENDEE;CN="Chris Herrenberger";DIR="addressbook://B14A390C-9CFD-11D8-8561-000D93C1A604:ABPerson":invalid:nomail
|
||||
ATTENDEE;CN="Horst Parplies";DIR="addressbook://B19B47E5-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:horst.parplies@freenet.de
|
||||
ATTENDEE;CN="Imdat Solak";DIR="addressbook://B19EDB62-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:imdat@solak.de
|
||||
ATTENDEE;CN="Jens Enders";DIR="addressbook://B1B6819F-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:jens.enders@skyrix.com
|
||||
ATTENDEE;CN="Jens Muenster";DIR="addressbook://B1BBA42E-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:jens.muenster@skyrix.com
|
||||
ATTENDEE;CN="Laurent Pierre";DIR="addressbook://9337C270-A825-11D8-B930-000D93C1A604:ABPerson":mailto:laurent.pierre@linagora.com
|
||||
ATTENDEE;CN="Marcel Weiher";DIR="addressbook://B1F9BB12-9CFD-11D8-8561-000D93C1A604:ABPerson":mailto:marcel@metaobject.co
|
||||
DTSTAMP:20040520T140002Z
|
||||
UID:BD91C454-AA65-11D8-84CA-000D93C1A604
|
||||
SEQUENCE:3
|
||||
STATUS:CONFIRMED
|
||||
DTSTART;TZID=Europe/Berlin:20040814T120000
|
||||
SUMMARY:SIZE EVENT
|
||||
X-WR-ITIPSTATUSML:UNCLEAN
|
||||
END:VEVENT
|
||||
'
|
||||
);
|
||||
|
||||
INSERT INTO SOGo_helge_privcal_quick
|
||||
( c_name, uid, startdate, enddate, title, participants, isallday, iscycle,
|
||||
location, partmails, sequence )
|
||||
VALUES (
|
||||
'BD91C454-AA65-11D8-84CA-000D93C1A604',
|
||||
'BD91C454-AA65-11D8-84CA-000D93C1A604',
|
||||
1092477600,
|
||||
1092481200,
|
||||
'SIZE EVENT',
|
||||
'Elke Bethke, Erik Doernenburg, Christian Schnelle, Chris Herrenberger, Horst Parplies, Imdat Solak, Jens Enders, Jens Muenster, Laurent Pierre, Marcel Weiher',
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
'E.Bethke@Sachsen-Anhalt-Lotto.de, erik@x101.net, cs@enervation.de, nomail, horst.parplies@freenet.de, imdat@solak.de, jens.enders@skyrix.com, jens.muenster@skyrix.com, laurent.pierre@linagora.com, marcel@metaobject.com',
|
||||
1
|
||||
);
|
||||
63
OGoContentStore/sql/testapt-hh.psql
Normal file
63
OGoContentStore/sql/testapt-hh.psql
Normal file
@@ -0,0 +1,63 @@
|
||||
-- $Id$
|
||||
--
|
||||
-- (C) 2004 SKYRIX Software AG
|
||||
--
|
||||
|
||||
DELETE FROM SOGo_helge_privcal
|
||||
WHERE c_name = 'BD91C454-AA65-11D8-84CA-000D93C1A604';
|
||||
DELETE FROM SOGo_helge_privcal_quick
|
||||
WHERE c_name = 'BD91C454-AA65-11D8-84CA-000D93C1A604';
|
||||
|
||||
|
||||
|
||||
INSERT INTO SOGo_helge_privcal
|
||||
( c_name, c_creationdate, c_lastmodified, c_version, c_content )
|
||||
VALUES (
|
||||
'BD91C454-AA65-11D8-84CA-000D93C1A604',
|
||||
928383,
|
||||
928383,
|
||||
1,
|
||||
|
||||
'BEGIN:VEVENT
|
||||
2
|
||||
DURATION:PT1H
|
||||
ATTENDEE;CN="Elke Bethke";DIR="addressbook://B156F3F0-9CFD-11D8-8561-000
|
||||
D93C1A604:ABPerson":mailto:E.Bethke@Sachsen-Anhalt-Lotto.de
|
||||
ATTENDEE;CN="Erik Doernenburg";DIR="addressbook://B15FCB0F-9CFD-11D8-8561
|
||||
-000D93C1A604:ABPerson":mailto:erik@x101.net
|
||||
ATTENDEE;CN="Christian Schnelle";DIR="addressbook://B1418D4E-9CFD-11D8-8
|
||||
561-000D93C1A604:ABPerson":mailto:cs@enervation.de
|
||||
ATTENDEE;CN="Chris Herrenberger";DIR="addressbook://B14A390C-9CFD-11D8-8
|
||||
561-000D93C1A604:ABPerson":invalid:nomail
|
||||
ATTENDEE;CN="Horst Parplies";DIR="addressbook://B19B47E5-9CFD-11D8-8561-
|
||||
000D93C1A604:ABPerson":mailto:horst.parplies@freenet.de
|
||||
ATTENDEE;CN="Imdat Solak";DIR="addressbook://B19EDB62-9CFD-11D8-8561-000
|
||||
D93C1A604:ABPerson":mailto:imdat@solak.de
|
||||
ATTENDEE;CN="Jens Enders";DIR="addressbook://B1B6819F-9CFD-11D8-8561-000
|
||||
D93C1A604:ABPerson":mailto:jens.enders@skyrix.com
|
||||
ATTENDEE;CN="Jens Muenster";DIR="addressbook://B1BBA42E-9CFD-11D8-8561-00
|
||||
0D93C1A604:ABPerson":mailto:jens.muenster@skyrix.com
|
||||
ATTENDEE;CN="Laurent Pierre";DIR="addressbook://9337C270-A825-11D8-B930-
|
||||
000D93C1A604:ABPerson":mailto:laurent.pierre@linagora.com
|
||||
ATTENDEE;CN="Marcel Weiher";DIR="addressbook://B1F9BB12-9CFD-11D8-8561-0
|
||||
00D93C1A604:ABPerson":mailto:marcel@metaobject.co
|
||||
DTSTAMP:20040520T140002Z
|
||||
UID:BD91C454-AA65-11D8-84CA-000D93C1A604
|
||||
SEQUENCE:3
|
||||
STATUS:CONFIRMED
|
||||
DTSTART;TZID=Europe/Berlin:20040618T160000
|
||||
SUMMARY:SIZE EVENT
|
||||
X-WR-ITIPSTATUSML:UNCLEAN
|
||||
END:VEVENT
|
||||
'
|
||||
);
|
||||
|
||||
INSERT INTO SOGo_helge_privcal_quick
|
||||
( c_name, uid, startdate, enddate, title, participants )
|
||||
VALUES (
|
||||
'BD91C454-AA65-11D8-84CA-000D93C1A604',
|
||||
'BD91C454-AA65-11D8-84CA-000D93C1A604',
|
||||
8928837,
|
||||
8929000,
|
||||
'SIZE EVENT',
|
||||
'Elke Bethke, Erik Doernenburg, Christian Schnelle, Chris Herrenberger, Horst Parplies, Imdat Solak, Jens Enders, Jens Muenster, Laurent Pierre, Marcel Weiher'
|
||||
33
OGoContentStore/sql/testcontact-agenor-test-contact.psql
Normal file
33
OGoContentStore/sql/testcontact-agenor-test-contact.psql
Normal file
@@ -0,0 +1,33 @@
|
||||
--
|
||||
-- (C) 2004 SKYRIX Software AG
|
||||
--
|
||||
|
||||
DELETE FROM SOGo_test_contacts_blob
|
||||
WHERE c_name = 'contact_donald';
|
||||
DELETE FROM SOGo_test_contacts_quick
|
||||
WHERE c_name = 'contact_donald';
|
||||
|
||||
INSERT INTO SOGo_test_contacts_blob
|
||||
( c_name, c_creationdate, c_lastmodified, c_version, c_content )
|
||||
VALUES (
|
||||
'contact_donald',
|
||||
928383,
|
||||
928383,
|
||||
1,
|
||||
'{
|
||||
givenName="Donald"; cn="Donald Duck"; sn="Duck";
|
||||
l="Entenhausen";
|
||||
mail="dd@entenhausen.com";
|
||||
o="Geldspeicher AG";
|
||||
ou="Support";
|
||||
telephoneNumber="0190-1234567";
|
||||
}'
|
||||
);
|
||||
|
||||
INSERT INTO SOGo_test_contacts_quick
|
||||
( c_name, givenname, cn, sn, l, mail, o, ou, telephoneNumber )
|
||||
VALUES (
|
||||
'contact_donald', 'Donald', 'Donald Duck', 'Duck', 'Entenhausen',
|
||||
'dd@entenhausen.com', 'Geldspeicher AG', 'Support',
|
||||
'0190-1234567'
|
||||
);
|
||||
Reference in New Issue
Block a user