134 {'x': eid, 'n': netype}) |
134 {'x': eid, 'n': netype}) |
135 session.system_sql('UPDATE entities SET type=%(n)s WHERE type=%(x)s', |
135 session.system_sql('UPDATE entities SET type=%(n)s WHERE type=%(x)s', |
136 {'x': etype, 'n': netype}) |
136 {'x': etype, 'n': netype}) |
137 # XXX should be donne as well on sqlite based sources |
137 # XXX should be donne as well on sqlite based sources |
138 if not etype in OLD_SCHEMA_TYPES and \ |
138 if not etype in OLD_SCHEMA_TYPES and \ |
139 (getattr(dbhelper, 'case_sensitive', False) |
139 (getattr(dbhelper, 'case_sensitive', False) |
140 or etype.lower() != netype.lower()): |
140 or etype.lower() != netype.lower()): |
141 session.system_sql('ALTER TABLE %s%s RENAME TO %s%s' % ( |
141 session.system_sql('ALTER TABLE %s%s RENAME TO %s%s' % ( |
142 sqlutils.SQL_PREFIX, etype, sqlutils.SQL_PREFIX, netype)) |
142 sqlutils.SQL_PREFIX, etype, sqlutils.SQL_PREFIX, netype)) |
143 session.commit(False) |
143 session.commit(False) |
144 try: |
144 try: |