Re-fix TypeError on drop_column for SQLite

Fixing bad interpretation on the value (tuple) when iterating on the dictionary
in previous changeset 9c2eb1b04df8

issue2647
review33491002
This commit is contained in:
Maxime Richez committed 2016-10-24 16:15:28 +02:00
1 parent 1bfc16bcf2
commit 6144237ef6
1 file changed
+4 -3
+4 -3
View File
@@ -299,10 +299,11 @@ class TableHandler(TableHandlerInterface):
logger.warning('Unable to drop column: Error renaming '
'table %s to temp!', self.table_name)
new_table = TableHandler(self._model, history=self.history)
for name, column in self._columns.iteritems():
for name, (notnull, hasdef, size, typname) \
in self._columns.iteritems():
if name != column_name:
new_table.add_raw_column(name, column['typname'], True,
field_size=column['size'])
new_table.add_raw_column(name, typname, True,
field_size=size)
columns_name = [x for x in new_table._columns.keys()]
cursor.execute(('INSERT INTO "%s" (' +
','.join('"%s"' % c for c in columns_name) +