diff options
author | Chris Withers <chris@simplistix.co.uk> | 2010-09-16 21:10:17 +0100 |
---|---|---|
committer | Chris Withers <chris@simplistix.co.uk> | 2010-09-16 21:10:17 +0100 |
commit | 4bcb4c98f9756882b986d5c31fc19065b4a1fd1c (patch) | |
tree | 1a5e041e1c41a42acff85eb1161e12b525315728 /lib/sqlalchemy/schema.py | |
parent | 27cf184b50ceed185fea57abfb329d2b9f9da935 (diff) | |
download | sqlalchemy-4bcb4c98f9756882b986d5c31fc19065b4a1fd1c.tar.gz |
add warning about dodgy use of tometadata
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r-- | lib/sqlalchemy/schema.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index fc5dd33df..99e8c2a8c 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -471,7 +471,11 @@ class Table(SchemaItem, expression.TableClause): if schema is RETAIN_SCHEMA: schema = self.schema key = _get_table_key(self.name, schema) - return metadata.tables[key] + result = metadata.tables[key] + util.warn('tometadata will raise an exception ' + 'when a table already exists in the ' + 'target metadata in SQLAlchemy 0.7') + return result except KeyError: args = [] for c in self.columns: |