Skip to content

underscored option bug with foreign key #11062

Closed

Description

@nithramus

What are you doing?

To Reproduce
Steps to reproduce the behavior:
My repo on which I reproduce the error

  1. Define model User and Project with option underscored
  2. User.belongsTo(Project)
// This will not work and project_id will not be set (NULL)
     await User.create({first_name: 'firstUser', last_name: 'firstUser', project_id: 1})
      // This will work and it will set project_id to 2
      await User.create({first_name: 'secondUser', last_name: 'secondUser', projectId: 2})    

What do you expect to happen?

project_id should be the one working (as in sequelize 4)

What is actually happening?

projectId is the one working

Environment

Dialect:

  • [] mysql
    Dialect library version: 1.6.5
    Database version:8.0
    Sequelize version: XXX
    Node Version: 10.15
    OS: linux/mac
    Tested with latest release:
  • Yes, specify that version: 5.8.9

Activity

  1. frastlin commented on Jul 18, 2019

    @frastlin

    Note that even when you create the entry with underscored: true, you still get the camelcase name.
    This means that underscored: true is broken as of Sequelize 5.10.1.

  2. self-assigned this
    on Jul 23, 2019
  3. papb commented on Jul 25, 2019

    @papb
    Member

    Closing in favor of #11225.

    When #11225 gets closed, if anyone thinks this particular issue is still an issue, please ping me.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions