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 cycleenddate INT NULL, /* enddate for cyclic events */
65 title VARCHAR(1000) NOT NULL,
66 cycleinfo VARCHAR(1000) NULL, /* property list with cycle infos */
67 participants VARCHAR(100000) NOT NULL, /* the CNs of the participants */
69 iscycle INT NULL, /* client needs to fetch to resolve */
70 ispublic INT NOT NULL,
73 priority INT NOT NULL, -- for marking high prio apts
74 location VARCHAR(256) NULL,
75 orgmail VARCHAR(256) NULL,
76 partmails VARCHAR(100000) NOT NULL, /* the emails of the participants */
77 partstates VARCHAR(256) NOT NULL, /* the status of each participant */
78 sequence INT NULL /* the iCal sequence */
81 CREATE TABLE SOGo_${USER_TABLE}_privcal_blob (
82 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
83 c_content VARCHAR(100000) NOT NULL, /* the BLOB */
84 c_creationdate INT NOT NULL, /* creation date */
85 c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
86 c_version INT NOT NULL /* version counter */
89 DROP TABLE SOGo_${USER_TABLE}_contacts_quick;
90 DROP TABLE SOGo_${USER_TABLE}_contacts_blob;
92 CREATE TABLE SOGo_${USER_TABLE}_contacts_quick (
93 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
94 givenname VARCHAR(256),
101 telephonenumber VARCHAR(256)
104 CREATE TABLE SOGo_${USER_TABLE}_contacts_blob (
105 c_name VARCHAR(256) NOT NULL PRIMARY KEY, /* the filename */
106 c_content VARCHAR(100000) NOT NULL, /* the BLOB */
107 c_creationdate INT NOT NULL, /* creation date */
108 c_lastmodified INT NOT NULL, /* last modification (UPDATE) */
109 c_version INT NOT NULL /* version counter */