server/schemaserial.py
brancholdstable
changeset 6734 ec9a5efdc451
parent 6213 efde9f08f2ae
child 6815 a84190d4e78c
--- a/server/schemaserial.py	Thu Dec 09 14:35:20 2010 +0000
+++ b/server/schemaserial.py	Thu Dec 09 14:55:51 2010 +0100
@@ -126,8 +126,9 @@
                 sqlexec('UPDATE %(p)sCWEType SET %(p)sname=%%(n)s WHERE %(p)seid=%%(x)s'
                         % {'p': sqlutils.SQL_PREFIX}, {'x': eid, 'n': netype})
                 if etype.lower() != netype.lower():
-                    sqlexec('ALTER TABLE %s%s RENAME TO %s%s' % (
-                        sqlutils.SQL_PREFIX, etype, sqlutils.SQL_PREFIX, netype))
+                    alter_table_sql = dbhelper.sql_rename_table(sqlutils.SQL_PREFIX+etype,
+                                                                sqlutils.SQL_PREFIX+netype)
+                    sqlexec(alter_table_sql)
             sqlexec('UPDATE entities SET type=%(n)s WHERE type=%(x)s',
                     {'x': etype, 'n': netype})
             session.commit(False)