From 66835e14a92993029bc83a5207704b8cc1929992 Mon Sep 17 00:00:00 2001 From: znek Date: Thu, 1 Jul 2004 00:42:20 +0000 Subject: [PATCH] bugfixes git-svn-id: http://svn.opengroupware.org/SOGo/trunk@133 d1b88da0-ebda-0310-925b-ed51d893ca5b --- db/scripts/create_user_tables.py | 43 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/db/scripts/create_user_tables.py b/db/scripts/create_user_tables.py index 6049e435..52911fbc 100755 --- a/db/scripts/create_user_tables.py +++ b/db/scripts/create_user_tables.py @@ -1,5 +1,12 @@ #!/usr/bin/env python +""" +README!!! + +Check the table names in +CREATE_QUICK + CREATE_BLOB -> are the table names correct? +""" + import pg import sys import random @@ -26,22 +33,22 @@ connectionPool = {} # TEMPLATES # -CREATE_QUICK="""CREATE TABLE %(user)s_quick ( - c_name VARCHAR(256) NOT NULL PRIMARY KEY, -- the filename +CREATE_QUICK="""CREATE TABLE SOGo_%(user)s_privcal_quick ( + c_name VARCHAR(256) NOT NULL PRIMARY KEY, uid VARCHAR(256) NOT NULL, startdate INT NOT NULL, enddate INT NOT NULL, title VARCHAR(1000) NOT NULL, participants VARCHAR(100000) NOT NULL -);""" +)""" -CREATE_BLOB="""CREATE TABLE %(user)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 -);""" +CREATE_BLOB="""CREATE TABLE SOGo_%(user)s_privcal ( + c_name VARCHAR(256) NOT NULL PRIMARY KEY, + c_content VARCHAR(100000) NOT NULL, + c_creationdate INT NOT NULL, + c_lastmodified INT NOT NULL, + c_version INT NOT NULL +)""" INSERT_FOLDERINFO_USER="""INSERT INTO SOGo_folder_info ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, @@ -53,9 +60,10 @@ VALUES NULL, NULL, '%(user)s', - 'http://%(connection)/%(db)/SOGo_user_folder', - 'http://%(connection)s/%(db)/SOGo_user_folder_quick', - 'Container' );""" + 'http://%(connection)s/%(db)s/SOGo_user_folder', + 'http://%(connection)s/%(db)s/SOGo_user_folder_quick', + 'Container' +)""" INSERT_FOLDERINFO_USER_PRIVCAL="""INSERT INTO SOGo_folder_info ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, @@ -67,9 +75,10 @@ VALUES 'Calendar', NULL, 'Calendar', - 'http://%(connection)s/%(db)/SOGo_%(user)s_privcal', - 'http://%(connection)s/%(db)/SOGo_%(user)s_privcal_quick', - 'Appointment' );""" + 'http://%(connection)s/%(db)s/SOGo_%(user)s_privcal', + 'http://%(connection)s/%(db)s/SOGo_%(user)s_privcal_quick', + 'Appointment' +)""" # @@ -140,7 +149,7 @@ def run(): "db" : db, "connection" : dbConnectionMap[db], } - + con.query(CREATE_QUICK % map) con.query(CREATE_BLOB % map) defcon.query(INSERT_FOLDERINFO_USER % map) -- 2.39.2