summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/ddl.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-03-02 17:47:58 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-03-02 17:47:58 -0500
commit6ddfe3b390fac8e5c7ef633ad5dd67463e94443b (patch)
treef3e09b731dfd88181012aa4f3d8a2cbe293315f1 /lib/sqlalchemy/engine/ddl.py
parent7090ca9b0951c1a59d6d66fc70c003dcc4ddf239 (diff)
downloadsqlalchemy-6ddfe3b390fac8e5c7ef633ad5dd67463e94443b.tar.gz
- :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
Diffstat (limited to 'lib/sqlalchemy/engine/ddl.py')
-rw-r--r--lib/sqlalchemy/engine/ddl.py6
1 files changed, 3 insertions, 3 deletions
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()