Commits

Mike Bayer committed 319a569

- add schema here to the FK

  • Participants
  • Parent commits 5c82e8e

Comments (0)

Files changed (1)

File tests/test_autogenerate.py

                 server_default="0"),
     )
 
+    if schema is not None:
+        schema_arg = schema + "."
+    else:
+        schema_arg = ""
+
     Table('extra', m,
         Column("x", CHAR),
-        Column('uid', Integer, ForeignKey('user.id'))
+        Column('uid', Integer, ForeignKey('%suser.id' % schema_arg))
     )
 
     return m
     sa.Column('description', sa.String(length=100), nullable=True),
     sa.Column('order_id', sa.Integer(), nullable=True),
     sa.CheckConstraint('len(description) > 5'),
-    sa.ForeignKeyConstraint(['order_id'], ['order.order_id'], ),
+    sa.ForeignKeyConstraint(['order_id'], ['%(schema)s.order.order_id'], ),
     sa.PrimaryKeyConstraint('id'),
     schema='%(schema)s'
     )