Commits

Mike Bayer committed be1649a

- Reflecting a FOREIGN KEY construct will take into account
a dotted schema.tablename combination, if the foreign key
references a table in a remote schema. [ticket:1405]

Comments (0)

Files changed (2)

       ForeignKey constructed from __clause_element__() style
       construct (i.e. declarative columns).  [ticket:1353]
 
+- mysql
+    - Reflecting a FOREIGN KEY construct will take into account
+      a dotted schema.tablename combination, if the foreign key
+      references a table in a remote schema. [ticket:1405]
+      
 - mssql
     - Modified how savepoint logic works to prevent it from
       stepping on non-savepoint oriented routines. Savepoint

lib/sqlalchemy/databases/mysql.py

             r'%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s +'
             r'FOREIGN KEY +'
             r'\((?P<local>[^\)]+?)\) REFERENCES +'
-            r'(?P<table>%(iq)s[^%(fq)s]+%(fq)s) +'
+            r'(?P<table>%(iq)s[^%(fq)s]+%(fq)s(?:\.%(iq)s[^%(fq)s]+%(fq)s)?) +'
             r'\((?P<foreign>[^\)]+?)\)'
             r'(?: +(?P<match>MATCH \w+))?'
             r'(?: +ON DELETE (?P<ondelete>%(on)s))?'