From 6ddfe3b390fac8e5c7ef633ad5dd67463e94443b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 2 Mar 2013 17:47:58 -0500 Subject: - :meth:`.MetaData.create_all` and :meth:`.MetaData.drop_all` will now accommodate an empty list as an instruction to not create/drop any items, rather than ignoring the collection. [ticket:2664]. This is a behavioral change and extra notes to the changelog and migration document have been added. - create a new test suite for exercising codepaths in engine/ddl.py --- lib/sqlalchemy/engine/ddl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/engine') diff --git a/lib/sqlalchemy/engine/ddl.py b/lib/sqlalchemy/engine/ddl.py index 6035e2901..c61a9d59c 100644 --- a/lib/sqlalchemy/engine/ddl.py +++ b/lib/sqlalchemy/engine/ddl.py @@ -21,7 +21,7 @@ class SchemaGenerator(DDLBase): tables=None, **kwargs): super(SchemaGenerator, self).__init__(connection, **kwargs) self.checkfirst = checkfirst - self.tables = tables and set(tables) or None + self.tables = tables self.preparer = dialect.identifier_preparer self.dialect = dialect self.memo = {} @@ -49,7 +49,7 @@ class SchemaGenerator(DDLBase): ) def visit_metadata(self, metadata): - if self.tables: + if self.tables is not None: tables = self.tables else: tables = metadata.tables.values() @@ -117,7 +117,7 @@ class SchemaDropper(DDLBase): self.memo = {} def visit_metadata(self, metadata): - if self.tables: + if self.tables is not None: tables = self.tables else: tables = metadata.tables.values() -- cgit v1.2.1