diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -375,6 +375,9 @@ CHANGES - Fixed bug in exception raise when FK columns not present during reflection. [ticket:1241] + + - Fixed bug involving reflection of a remote-schema table with + a foreign key ref to another table in that schema. - associationproxy - The association proxy properties are make themselves available diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 1b977dce9..045225c93 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -2306,7 +2306,7 @@ class MySQLSchemaReflector(object): for spec in constraints: # only FOREIGN KEYs ref_name = spec['table'][-1] - ref_schema = len(spec['table']) > 1 and spec['table'][-2] or None + ref_schema = len(spec['table']) > 1 and spec['table'][-2] or table.schema if not ref_schema: if default_schema is None: |