-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Tables whos primary key isn't called ID #55
Comments
Hello @cursey, You're right, right now this one is hard-coded, but should support an override. In the meanwhile, you can use |
@markbates @stanislas-m Some strategy needs to be laid out for these id mapping issues. Also, we need a better test coverage of the associations. |
I am using postgres and I am getting the
I have tried using the |
@nithin-bose No, the tag on the ID is not taken into consideration. It is hardcoded currently. |
I'd vote for a
Could you elaborate @petar-dambovaliev ? |
Hi there
It would respect Db design BUT what I found in codes pop/dialect_postgresql.go:60:
BUT SHOULD BE:
Not event "dialect_postgresql.go" but:
Anyone can do a favor to me, and tell me how to change them locally till these updates done? |
After some googling finally found that (git init, git add .) able me to change files! This will works:
|
Hi,
I'm new to both Go and Buffalo. I don't know what to do when trying to interface with an existing database who's tables primary key's aren't called ID. For instance there is a
user
table and the primary key is calleduser_id
. From what I can tellpop.Query.Find
is the responsible function because it's insertingid
as a hard-coded string. Maybe there could be a way of overriding the primary key name like there is a way of overriding the table name by implementingTableNameAble
?Thanks!
Edit: Looking further I guess I can just use
pop.Query.Where
instead. Is that the proper way of handling this?The text was updated successfully, but these errors were encountered: