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

addProfile is not function on many to many relationship #688

Open
s1nistr4 opened this issue Jan 6, 2024 · 1 comment
Open

addProfile is not function on many to many relationship #688

s1nistr4 opened this issue Jan 6, 2024 · 1 comment

Comments

@s1nistr4
Copy link

s1nistr4 commented Jan 6, 2024

Bug Description

I am copying and pasting the following from here to set up a one to many relationship, it says .addProfile is not a function, after copying and pasting the code with the table definitions already set up in the readme. This also goes if I switch the name "Profile" to the child element, such as addCart or addTag, etc.

When you compile the code, it says ".addProfile" is not a function.
I'm assuming sequelize dynamically creates this method but that doesn't seem to happen

What do you expect to happen?

For it to not give an error

What is actually happening?

Gives an error

@ephys ephys transferred this issue from sequelize/sequelize Feb 2, 2024
@ephys
Copy link
Member

ephys commented Feb 2, 2024

You can check what methods are available on your model by calling console.dir(User.prototype) after having called User.belongsToMany(Profile)

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

2 participants