summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/information_schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-07-22 06:21:58 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-07-22 06:21:58 +0000
commit946984d812dcade87a6cbefbb896e4a17af8170e (patch)
treedf8794e80f557baedac9fbdb5720f12b6e470c2a /lib/sqlalchemy/databases/information_schema.py
parentf65fdce01daec6c49359f04d90669919d836e3b5 (diff)
downloadsqlalchemy-946984d812dcade87a6cbefbb896e4a17af8170e.tar.gz
fixed reflection of foreign keys to autoload the referenced table
if it was not loaded already, affected postgres, mysql, oracle. fixes the latest in [ticket:105]
Diffstat (limited to 'lib/sqlalchemy/databases/information_schema.py')
-rw-r--r--lib/sqlalchemy/databases/information_schema.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/information_schema.py b/lib/sqlalchemy/databases/information_schema.py
index 296db2de5..291637e9e 100644
--- a/lib/sqlalchemy/databases/information_schema.py
+++ b/lib/sqlalchemy/databases/information_schema.py
@@ -185,8 +185,10 @@ def reflecttable(connection, table, ischema_names):
if current_schema == referred_schema:
referred_schema = table.schema
if referred_schema is not None:
+ schema.Table(referred_table, table.metadata, autoload=True, schema=referred_schema, autoload_with=connection)
refspec = ".".join([referred_schema, referred_table, referred_column])
else:
+ schema.Table(referred_table, table.metadata, autoload=True, autoload_with=connection)
refspec = ".".join([referred_table, referred_column])
if constrained_column not in fk[0]:
fk[0].append(constrained_column)