]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix the unpacking of the refered table name under Firebird
authorLele Gaifax <lele@metapensiero.it>
Wed, 19 Dec 2007 08:03:57 +0000 (08:03 +0000)
committerLele Gaifax <lele@metapensiero.it>
Wed, 19 Dec 2007 08:03:57 +0000 (08:03 +0000)
This fixes a little glitch introduced in [3959], in case of "implicit FKs"
(that is, {{{ForeignKey("orders")}}}, where the field(s) is missing).

test/testlib/schema.py

index 96a81d5bea967e2271f5f7521b4c5145503b8d8f..8151508d0648c64f9ebd3581b3f43b89680254d3 100644 (file)
@@ -42,7 +42,10 @@ def Table(*args, **kw):
             if isinstance(ref, schema.Column):
                 name = ref.table.name
             else:
-                name = unpack(ref)[-2]
+                # take just the table name: on FB there cannot be
+                # a schema, so the first element is always the
+                # table name, possibly followed by the field name
+                name = unpack(ref)[0]
             print name, table_name
             if name == table_name:
                 if fk.ondelete is None: