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

updateOnDuplicate problem when set to true. #9288

Closed
nthypes opened this issue Apr 11, 2018 · 2 comments
Closed

updateOnDuplicate problem when set to true. #9288

nthypes opened this issue Apr 11, 2018 · 2 comments
Milestone

Comments

@nthypes
Copy link

@nthypes nthypes commented Apr 11, 2018

Looking the code of updateOnDuplicate looks like we can set an array of fields or a boolean . If we pass a boolean true, the bulkCreate tries to update the primary key field as well, trowing an SequelizeForeignKeyConstraintError SequelizeForeignKeyConstraintError: Cannot delete or update a parent row error.

Code: https://github.com/sequelize/sequelize/blob/66fb6b67a74c107bfaf72304db315bf600c37921/lib/model.js#L2348`

@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Apr 11, 2018

I will remove boolean support and just keep array option as docs say

@sushantdhiman sushantdhiman added this to the v5 milestone Apr 11, 2018
@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Apr 11, 2018

Fixed by 8b937dd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants