add test case for ensure_foreign_key_for