drop_all(tables=[]) doesn't work

Issue #2664 resolved
Andrew Lutomirski created an issue

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)

  1. Mike Bayer repo owner

    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.

  2. Log in to comment