]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Reflecting a FOREIGN KEY construct will take into account
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 May 2009 22:00:33 +0000 (22:00 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 May 2009 22:00:33 +0000 (22:00 +0000)
a dotted schema.tablename combination, if the foreign key
references a table in a remote schema. [ticket:1405]

CHANGES
lib/sqlalchemy/databases/mysql.py

diff --git a/CHANGES b/CHANGES
index 4250bfffefda508f1e5d83f191ae7be3028ff2ed..5e0bc71e57b4a67303662257f71e1173b74ae390 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -147,6 +147,11 @@ CHANGES
       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
index c2b233a6e9dafc03a901402d9c8301111452169d..ba6b026ea29aac857be41bbe8563e904dfc2ff43 100644 (file)
@@ -2471,7 +2471,7 @@ class MySQLSchemaReflector(object):
             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))?'