should use sql prefix here stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 May 2009 15:06:33 +0200
branchstable
changeset 1869 642a1a120a92
parent 1868 af1ae863606d
child 1871 b54512ff3884
should use sql prefix here
server/schemaserial.py
--- a/server/schemaserial.py	Tue May 19 14:31:42 2009 +0200
+++ b/server/schemaserial.py	Tue May 19 15:06:33 2009 +0200
@@ -14,6 +14,7 @@
 from yams import schema as schemamod, buildobjs as ybo
 
 from cubicweb.schema import CONSTRAINTS, ETYPE_NAME_MAP
+from cubicweb.server import sqlutils
 
 def group_mapping(cursor, interactive=True):
     """create a group mapping from an rql cursor
@@ -124,7 +125,8 @@
         if etype in ETYPE_NAME_MAP: # XXX <2.45 bw compat
             print 'fixing etype name from %s to %s' % (etype, ETYPE_NAME_MAP[etype])
             # can't use write rql queries at this point, use raw sql
-            session.system_sql('UPDATE CWEType SET name=%(n)s WHERE eid=%(x)s',
+            session.system_sql('UPDATE %(p)sCWEType SET %(p)sname=%%(n)s WHERE %(p)seid=%%(x)s'
+                               % {'p': sqlutils.SQL_PREFIX},
                                {'x': eid, 'n': ETYPE_NAME_MAP[etype]})
             session.system_sql('UPDATE entities SET type=%(n)s WHERE type=%(x)s',
                                {'x': etype, 'n': ETYPE_NAME_MAP[etype]})