3 # Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...]
6 DB="/tmp/sogo-registry.sqlite"
8 while [ "$1" != "" ]; do
10 USER_TABLE=`echo $USER_ID | tr -s [:punct:] _`
12 DELETE FROM SOGo_folder_info WHERE c_path2 = '${USER_ID}';
14 INSERT INTO SOGo_folder_info
15 ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
16 c_location, c_quick_location, c_folder_type )
18 ( '/Users/${USER_ID}',
24 'sqlite://localhost${DB}/SOGo_user_folder_blob',
25 'sqlite://localhost${DB}/SOGo_user_folder_quick',
28 INSERT INTO SOGo_folder_info
29 ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
30 c_location, c_quick_location, c_folder_type )
32 ( '/Users/${USER_ID}/Calendar',
38 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal_blob',
39 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_privcal_quick',
42 INSERT INTO SOGo_folder_info
43 ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername,
44 c_location, c_quick_location, c_folder_type )
46 ( '/Users/${USER_ID}/Contacts',
52 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts_blob',
53 'sqlite://localhost${DB}/SOGo_${USER_TABLE}_contacts_quick',
56 DROP TABLE SOGo_${USER_TABLE}_privcal_quick;
57 DROP TABLE SOGo_${USER_TABLE}_privcal_blob;
59 CREATE TABLE SOGo_${USER_TABLE}_privcal_quick (
60 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
61 uid VARCHAR(256) NOT NULL,
62 startdate INT NOT NULL,
64 title VARCHAR(1000) NOT NULL,
65 participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */
67 iscycle INT NULL, /* client needs to fetch to resolve */
68 ispublic INT NOT NULL,
71 location VARCHAR(256) NULL,
72 orgmail VARCHAR(256) NULL,
73 partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */
74 partstates VARCHAR(256) NOT NULL, /* the status of each participant */
75 sequence INT NULL /* the iCal sequence */
78 CREATE TABLE SOGo_${USER_TABLE}_privcal_blob (
79 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
80 c_content VARCHAR(100000) NOT NULL, /* the BLOB */
81 c_creationdate INT NOT NULL, /* creation date */
82 c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
83 c_version INT NOT NULL /* version counter */
86 DROP TABLE SOGo_${USER_TABLE}_contacts_quick;
87 DROP TABLE SOGo_${USER_TABLE}_contacts_blob;
89 CREATE TABLE SOGo_${USER_TABLE}_contacts_quick (
90 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
91 givenname VARCHAR(256),
98 telephonenumber VARCHAR(256)
101 CREATE TABLE SOGo_${USER_TABLE}_contacts_blob (
102 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
103 c_content VARCHAR(100000) NOT NULL, /* the BLOB */
104 c_creationdate INT NOT NULL, /* creation date */
105 c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
106 c_version INT NOT NULL /* version counter */