Monotone-Parent: 21d3c266f32d058a6d1133567ac844486a87d2b3

Monotone-Revision: 293e773bade06f97acb90961a13323cdf0e8bcd7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-12-15T22:17:25
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-12-15 22:17:25 +00:00
parent e763a81abc
commit 17a4faa5f6
3 changed files with 60 additions and 74 deletions
+28 -69
View File
@@ -21,84 +21,43 @@ cat << EOF
-- TODO:
-- add a unique constraints on path
DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}' AND c_folder_type = 'Acls';
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}/acls',
'Users',
'${USER_ID}',
'acls',
NULL,
'acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_acls',
'Acls' );
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/acls',
'Users',
'${USER_ID}',
'Calendar',
'acls',
'acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal_acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal_acls',
'Acls' );
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/acls',
'Users',
'${USER_ID}',
'Contacts',
'acls',
'acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acls',
'Acls' );
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/personal/acls',
'Users',
'${USER_ID}',
'Contacts',
'personal',
'acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acls',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acls',
'Acls' );
UPDATE SOGo_folder_info
SET c_acl_location = 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_acl'
WHERE c_folder_type = 'Container'
AND c_path2 = '${USER_ID}';
UPDATE SOGo_folder_info
SET c_acl_location = 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acl'
WHERE c_folder_type = 'Contact'
AND c_path2 = '${USER_ID}';
UPDATE SOGo_folder_info
SET c_acl_location = 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal_acl'
WHERE c_folder_type = 'Appointment'
AND c_path2 = '${USER_ID}';
DROP TABLE SOGo_${USER_TABLE}_acls;
DROP TABLE SOGo_${USER_TABLE}_privcal_acls;
DROP TABLE SOGo_${USER_TABLE}_contacts_acls;
CREATE TABLE SOGo_${USER_TABLE}_acls (
uid VARCHAR(256) NOT NULL,
object VARCHAR(256) NOT NULL,
role VARCHAR(80) NOT NULL
DROP TABLE SOGo_${USER_TABLE}_acl;
DROP TABLE SOGo_${USER_TABLE}_privcal_acl;
DROP TABLE SOGo_${USER_TABLE}_contacts_acl;
CREATE TABLE SOGo_${USER_TABLE}_acl (
c_uid VARCHAR(256) NOT NULL,
c_object VARCHAR(256) NOT NULL,
c_role VARCHAR(80) NOT NULL
);
CREATE TABLE SOGo_${USER_TABLE}_privcal_acls (
uid VARCHAR(256) NOT NULL,
object VARCHAR(256) NOT NULL,
role VARCHAR(80) NOT NULL
CREATE TABLE SOGo_${USER_TABLE}_privcal_acl (
c_uid VARCHAR(256) NOT NULL,
c_object VARCHAR(256) NOT NULL,
c_role VARCHAR(80) NOT NULL
);
CREATE TABLE SOGo_${USER_TABLE}_contacts_acls (
uid VARCHAR(256) NOT NULL,
object VARCHAR(256) NOT NULL,
role VARCHAR(80) NOT NULL
CREATE TABLE SOGo_${USER_TABLE}_contacts_acl (
c_uid VARCHAR(256) NOT NULL,
c_object VARCHAR(256) NOT NULL,
c_role VARCHAR(80) NOT NULL
);
EOF
@@ -21,6 +21,7 @@ CREATE TABLE SOGo_folder_info (
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_acl_location VARCHAR(2048) NULL, -- URL to quicktable of folder
c_folder_type VARCHAR(255) NOT NULL -- the folder type ...
);
@@ -36,4 +37,5 @@ VALUES
'Users',
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder',
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder_quick',
'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder_acl',
'Container' );
@@ -25,7 +25,7 @@ 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 )
c_location, c_quick_location, c_acl_location, c_folder_type )
VALUES
( '/Users/${USER_ID}',
'Users',
@@ -33,13 +33,14 @@ VALUES
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',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_folder',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_quick',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_acl',
'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 )
c_location, c_quick_location, c_acl_location, c_folder_type )
VALUES
( '/Users/${USER_ID}/Calendar',
'Users',
@@ -49,11 +50,12 @@ VALUES
'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',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal_acl',
'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 )
c_location, c_quick_location, c_acl_location, c_folder_type )
VALUES
( '/Users/${USER_ID}/Contacts/personal',
'Users',
@@ -63,6 +65,7 @@ VALUES
'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',
'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acl',
'Contact' );
DROP TABLE SOGo_${USER_TABLE}_privcal_quick;
@@ -122,6 +125,28 @@ CREATE TABLE SOGo_${USER_TABLE}_contacts (
c_version INT NOT NULL -- version counter
);
DROP TABLE SOGo_${USER_TABLE}_acl;
DROP TABLE SOGo_${USER_TABLE}_privcal_acl;
DROP TABLE SOGo_${USER_TABLE}_contacts_acl;
CREATE TABLE SOGo_${USER_TABLE}_acl (
c_uid VARCHAR(256) NOT NULL,
c_object VARCHAR(256) NOT NULL,
c_role VARCHAR(80) NOT NULL
);
CREATE TABLE SOGo_${USER_TABLE}_privcal_acl (
c_uid VARCHAR(256) NOT NULL,
c_object VARCHAR(256) NOT NULL,
c_role VARCHAR(80) NOT NULL
);
CREATE TABLE SOGo_${USER_TABLE}_contacts_acl (
c_uid VARCHAR(256) NOT NULL,
c_object VARCHAR(256) NOT NULL,
c_role VARCHAR(80) NOT NULL
);
DELETE FROM SOGo_user_profile WHERE uid = '${USER_ID}';
INSERT INTO SOGo_user_profile (