-
Notifications
You must be signed in to change notification settings - Fork 550
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
postgres: Foreign Keys with same name cause compilation errors #85
Comments
Hmm, this only appears to be affecting Postgres. We're looking into it. Thanks for letting us know. |
Sure thing! |
The crux of the issue is that mysql uses names to uniquely identify constraint names and postgres doesn't care. There's a duplicate key name in there (pilots_fkey) and so our postgres driver query gets stupefied. I do have a fix that's almost ready, but won't be able to get it into dev until tonight. Thanks for your patience and we've added this schema to our integration tests to ensure nothing like this happens in the future. |
That's great! do you want me to send a PR to fix the schema in the README or you got that fix in dev as well? |
It'll be in my commits :) Thanks for offering. |
I still seem to have this issue for tables that are referenced by multiple foreign keys with the same name. |
@jgrossophoff This should have fixed that sort of thing. It's possible there's still some other edges that the query isn't saving us from. A few questions:
|
The three referencing tables are many-to-many join tables. This is the schema of one of them:
And this is the services table:
(Some columns removed)
And all Service* methods on the MeasurementType type are declared 3 times.
Thank you very much in advance for all the effort! |
Closing this in favor of #92, not same issue. |
After executing the sql script defined in https://github.com/vattle/sqlboiler#features--examples into an empty database, and executing
sqlboiler postgres
, runninggo test ./models/
fails with the following message:I can also see, in almost all structs, that there is lots of duplicated entries. For example, the jetR struct is defined as followed, which is clearly wrong.
Another clear example is the
pilotR
struct, which not only has duplicated attributes, but it also misses theJets JetSlice
attribute.My Go version:
go version go1.7.4 windows/amd64
running postgres 9.5 on an Ubuntu VM.Thanks!
The text was updated successfully, but these errors were encountered: