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
antl3x opened this issue Apr 11, 2018 · 2 comments
Closed

updateOnDuplicate problem when set to true. #9288

antl3x opened this issue Apr 11, 2018 · 2 comments
Labels
breaking change For issues and PRs. Changes that break compatibility and require a major version increment.
Milestone

Comments

@antl3x
Copy link

antl3x 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

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

@sushantdhiman sushantdhiman added the breaking change For issues and PRs. Changes that break compatibility and require a major version increment. label Apr 11, 2018
@sushantdhiman sushantdhiman added this to the v5 milestone Apr 11, 2018
@sushantdhiman
Copy link
Contributor

Fixed by 8b937dd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change For issues and PRs. Changes that break compatibility and require a major version increment.
Projects
None yet
Development

No branches or pull requests

2 participants