-
Notifications
You must be signed in to change notification settings - Fork 461
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
强制同步问题 #21
Comments
你好,force: false 这样不会,如果 force: true 就会。等于true的意思是删表重新新建表的意思,既然删除表重新新建表,那么肯定数据也会没了。 |
force为false时怎么同步表字段啊? |
在开发阶段,在你创建表成功后,你新增或者删除了表字段,sequelizejs是不会重新再创建表的了,要么你手动删除该表,要么把force设置为true字段重新创建表,注意,force为true 会删除所有的表,在项目线上千万不能把force设置为true。 |
线上环境是force: false,如果后期需要在表中新增一个字段,但是又不能删表,那么直接在数据库增加字段而不需要在models 的init中新增的对吗?这样的话 是不是不太优雅,会导致数据库有的字段 在models创建数据库时是不存在的 |
The text was updated successfully, but these errors were encountered: