You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The query generated to handle a .find_with_related call does not respect the column_name attribute set in the Model struct: it uses the name derived from the struct field name.
Description
Defining a
has_many
relationship when the primary key is a column with acolumn_name
breaks.find_with_related
.Steps to Reproduce
See MWE repository.
Expected Behavior
When I run the query, I expect to retrieve the elements from the database.
Actual Behavior
The query fails with the following message:
Reproduces How Often
It reproduces every-time.
Versions
I am working with MySQL on a debian (not sure if it is relevant for this bug):
Additional Information
The query generated to handle a
.find_with_related
call does not respect thecolumn_name
attribute set in the Model struct: it uses the name derived from the struct field name.The generated query is the following:
The ORDER BY clause is wrongly generated as we should not get
rust_id
butdb_id
. The rest of the query is correctly generated.See https://github.com/bleuse/sea-orm-column-name-bug for a MWE.
The text was updated successfully, but these errors were encountered: