-
Notifications
You must be signed in to change notification settings - Fork 74
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
When i need force sync? #21
Comments
You don't need force sync. That was actually a bug in the generator. You should not have it in your code. If you see it in the docs please tell me where or do a PR and I will remove it. |
I have not seen this in the documentation. It seems that I generated application using the old generator. |
The latest version of generator adds this code in every model: user.sync(); Why we do this for each model instead sequelize instance? sequelize.sync() |
@kulakowka I didn't know you could do that. Looks like you can do either one. The choice is yours... 😄 |
Yes thank you. I've already figured out. |
I can not understand how works
sync
method.I have read the documentation about it. But I do not understand anything. When I have to do the synchronization? Each time when i restart my application it will be deleted all the data from database.
Or should I synchronize only the first time when i run the application and the database table has not yet been created?
But what if the model schema changes? Do i have to synchronize again?
Maybe anyone can share a link to a tutorial and examples?
The text was updated successfully, but these errors were encountered: