fix sqlite column dropper now that the table is only modified after the visitor is run

This commit is contained in:
Chris Withers 2011-02-10 15:17:28 +00:00
parent b1745bee52
commit 500cb6f5df

View File

@ -80,10 +80,19 @@ class SQLiteColumnDropper(SQLiteHelper, ansisql.ANSIColumnDropper):
"""SQLite ColumnDropper"""
def _modify_table(self, table, column, delta):
columns = ' ,'.join(map(self.preparer.format_column, table.columns))
return 'INSERT INTO %(table_name)s SELECT ' + columns + \
' from migration_tmp'
def visit_column(self,column):
# For SQLite, we *have* to remove the column so the table
# is re-created properly.
# This violates the alter_metadata settting, but that
# is going away...
column.remove_from_table(column.table,unset_table=False)
super(SQLiteColumnDropper,self).visit_column(column)
class SQLiteSchemaChanger(SQLiteHelper, ansisql.ANSISchemaChanger):
"""SQLite SchemaChanger"""