Skip to content

updateOnDuplicate problem when set to true. #9288

Closed
@antl3x

Description

@antl3x

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeFor issues and PRs. Changes that break compatibility and require a major version increment.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions