]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix parsing foreign key constraints with multiple dots.
authorAlexander Kolov <alex@snitchware.com>
Tue, 24 Apr 2012 00:19:03 +0000 (02:19 +0200)
committerAlexander Kolov <alex@snitchware.com>
Tue, 24 Apr 2012 00:19:03 +0000 (02:19 +0200)
alembic/operations.py

index f3150395d6fd592e336c5a4850280d8a0b020fc0..ece624868ea3d419418821ca5079f77e0334e305 100644 (file)
@@ -109,9 +109,9 @@ class Operations(object):
 
         """
         if isinstance(fk._colspec, basestring):
-            table_key, cname = fk._colspec.split('.')
+            table_key, cname = fk._colspec.rsplit('.', 1)
             if '.' in table_key:
-                tokens = tname.split('.')
+                tokens = table_key.split('.')
                 sname = ".".join(tokens[0:-1])
                 tname = tokens[-1]
             else: