Commits

Mike Bayer committed 1191fb1

fixed table name in REFERENCES clause to include schema if applicable

Comments (0)

Files changed (1)

lib/sqlalchemy/ansisql.py

             self.append("CONSTRAINT %s " % constraint.name)
         self.append("FOREIGN KEY(%s) REFERENCES %s (%s)" % (
             string.join([f.parent.name for f in constraint.elements], ', '),
-            list(constraint.elements)[0].column.table.name,
+            list(constraint.elements)[0].column.table.fullname,
             string.join([f.column.name for f in constraint.elements], ', ')
         ))
         if constraint.ondelete is not None: