-
Notifications
You must be signed in to change notification settings - Fork 285
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
I neet remove attribute id in model #1694
Comments
You need to make one of the fields a primary key otherwise id is auto added as primary key Also the error you are receiving is due to the model not being attached to the Sequelize instance, you can do that in one of two ways following the docs: https://github.com/sequelize/sequelize-typescript#configuration |
Do you have an alternative solution for fixing the issue in the model file? |
As given you need to make a primary key for the model otherwise a id primarykey gets added automatically. If you don't want id as your primary key then mark another field as primary key as below, you can use email ( which should be unique) and gives you a string primary key. `@Table({ @PrimaryKey |
give a @PrimaryKey in other filed |
Nodejs v18.17.1
sequelize v 6.33.0
sequelize-typescript v2.1.5
Error
The text was updated successfully, but these errors were encountered: