drop_all(tables=[]) doesn't work
Issue #2664
resolved
The bug is trivial: SchemaDropper starts out as like this.
class SchemaDropper(DDLBase):
def __init__(self, dialect, connection, checkfirst=False, tables=None, **kwargs):
super(SchemaDropper, self).__init__(connection, **kwargs)
self.checkfirst = checkfirst
self.tables = tables
self.preparer = dialect.identifier_preparer
self.dialect = dialect
self.memo = {}
def visit_metadata(self, metadata):
if self.tables:
tables = self.tables
else:
tables = metadata.tables.values()
That should be {{{if self.tables }}}''{{{is not None}}}''
See source:/lib/sqlalchemy/engine/ddl.py#L120
Comments (4)
-
reporter -
repo owner - changed milestone to 0.8.0final
- changed component to schema
- assigned issue to
I'm probably going to keep this in 0.8 as it might change the behavior of an 0.7 app that's unknowningly relying upon it.
-
repo owner - changed status to resolved
trivial change, but the testing/documentation fanfare surrounding it, not so much, as ddl.py wasn't independently covered. Extra notes added to the changelog/migration for this late-add behavioral change. 6ddfe3b390fac8e5c7ef633ad5dd67463e94443b
-
repo owner - removed milestone
Removing milestone: 0.8.0final (automated comment)
- Log in to comment
create_all has the same problem.