Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AmbiguousForeignKeysError #59

Closed
jacobsvante opened this issue Feb 11, 2014 · 5 comments
Closed

AmbiguousForeignKeysError #59

jacobsvante opened this issue Feb 11, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@jacobsvante
Copy link

This error seems to come up with sandmanctl when there are multiple foreign keys pointing to the same table. I haven't looked into the issue enough yet to know how hard it would be to add support for this, but perhaps an option could be added to ignore such columns?

@jeffknupp
Copy link
Owner

I thought this issue had been resolved. Checking into it.

On Tue, Feb 11, 2014 at 6:05 AM, Jacob Magnusson
notifications@github.comwrote:

This error https://gist.github.com/jmagnusson/8932939 seems to come up
with sandmanctl when there are multiple foreign keys pointing to the same
table. I haven't looked into the issue enough yet to know how hard it would
be to add support for this, but perhaps an option could be added to ignore
such columns?

Reply to this email directly or view it on GitHubhttps://github.com//issues/59
.

@jeffknupp jeffknupp self-assigned this Feb 20, 2014
@jeffknupp jeffknupp added this to the Release 0.8.0 milestone Feb 20, 2014
@jeffknupp jeffknupp added the bug label Feb 20, 2014
@bkcsfi
Copy link

bkcsfi commented Feb 24, 2014

I have encountered this error also with 0.7.7rc3, after deleting the troublesome tables encountered in #65 (test db only), I get:

sqlalchemy.exc.AmbiguousForeignKeysError

reading the sqla docs, I think the best fix for this might be related to #60, allow users to partially or fully declare the sqla mapping.

being lazy, I'd like to use automap in sandman and then I'd only need to declare the naming of the relationships between tables where there are multiple fk links.

@areski
Copy link
Contributor

areski commented Apr 6, 2014

Getting similar error with a django project "sqlalchemy.exc.AmbiguousForeignKeysError: Could not determine join condition between parent/child tables on relationship notification_notice.auth_user - there are multiple foreign key paths linking the tables. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference to the parent table."

@jeffknupp
Copy link
Owner

Multiple foreign keys to the same table are now supported.

@areski
Copy link
Contributor

areski commented Apr 8, 2014

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants