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

findByAssociation has problems with auto generated coloumn by .hasOne method with mapsTo option. #817

Open
reumia opened this issue Oct 19, 2017 · 0 comments

Comments

@reumia
Copy link

reumia commented Oct 19, 2017

// Defining Model
LikesCut.hasOne('target', Cuts, {reverse: 'likes', field: 'targetId', mapsTo: 'target_id', required: true})

// CASE 1 : ER_BAD_FIELD_ERROR: Unknown column 't1.targetId' in 'on clause'
LikesCut.findByTarget({}).runAsync()
// CASE 2 : ER_BAD_FIELD_ERROR: Unknown column 't2.targetId' in 'on clause'
Cuts.findByLikes({}).runAsync()

it seems to tying join with wrong column name.
is there something wrong in my codes or isn't it prepared yet?

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

No branches or pull requests

1 participant