server/schemaserial.py
changeset 2181 94ca417b9b07
parent 2144 51c84d585456
parent 2174 7f576dc9502e
child 2458 4d114865098f
equal deleted inserted replaced
2144:51c84d585456 2181:94ca417b9b07
   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: