Changeset 4432

Show
Ignore:
Timestamp:
04/04/09 22:33:49 (4 years ago)
Author:
gpolo
Message:

coldef is only needed if there are columns to be merged.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/umit/merger/sqlitedb.py

    r4431 r4432  
    258258 
    259259        # Attempt to create new columns 
     260        coldef = {} 
    260261        if new_by_col: 
    261262            print "Adding new columns in table '%s'" % tablename 
    262         # Get the full column definitions for this table 
    263         res = self._fromcursor.execute( 
    264                 "SELECT sql FROM sqlite_master " 
    265                 "WHERE type='table' and name=?", (tablename, )).fetchone() 
    266         coldef = column_definitions(res['sql']) 
     263            # Get the full column definitions for this table 
     264            res = self._fromcursor.execute( 
     265                    "SELECT sql FROM sqlite_master " 
     266                    "WHERE type='table' and name=?", (tablename, )).fetchone() 
     267            coldef.update(column_definitions(res['sql'])) 
    267268        for cname, cinfo in new_by_col.iteritems(): 
    268269            if cinfo['pk']: