summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-04-16 13:08:45 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-04-16 13:08:45 -0400
commit23f8c6c241a457d88bcb470e37a5d23926195290 (patch)
treed8c7c75f464fdcd16cea9cf1d4fe33308dbd4b54 /lib/sqlalchemy/schema.py
parenta4032d2929d82af81379893c3d2037ea253e929e (diff)
downloadsqlalchemy-23f8c6c241a457d88bcb470e37a5d23926195290.tar.gz
- Table.create() and Table.drop() no longer apply metadata-
level create/drop events. [ticket:1771]
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r--lib/sqlalchemy/schema.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index 0e03be686..4e4468a85 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -405,15 +405,23 @@ class Table(SchemaItem, expression.TableClause):
"""Issue a ``CREATE`` statement for this table.
See also ``metadata.create_all()``.
+
"""
- self.metadata.create_all(bind=bind, checkfirst=checkfirst, tables=[self])
+
+ if bind is None:
+ bind = _bind_or_error(self)
+ bind.create(self, checkfirst=checkfirst)
def drop(self, bind=None, checkfirst=False):
"""Issue a ``DROP`` statement for this table.
See also ``metadata.drop_all()``.
+
"""
- self.metadata.drop_all(bind=bind, checkfirst=checkfirst, tables=[self])
+ if bind is None:
+ bind = _bind_or_error(self)
+ bind.drop(self, checkfirst=checkfirst)
+
def tometadata(self, metadata, schema=RETAIN_SCHEMA):
"""Return a copy of this ``Table`` associated with a different ``MetaData``."""