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

请问,新建数据库表的话,先在models下新建了文件,重启项目没有生成表 #218

Open
1105065844 opened this issue Nov 29, 2022 · 1 comment

Comments

@1105065844
Copy link

No description provided.

@1105065844 1105065844 changed the title 请问,新建数据库表的话,先在models下新建了文件,重启项目没有生成表,请项目中怎么触发的sequelize.sync 请问,新建数据库表的话,先在models下新建了文件,重启项目没有生成表 Nov 29, 2022
@lfb
Copy link
Owner

lfb commented Nov 29, 2022

No description provided.

试下在:https://github.com/lfb/nodejs-koa-blog/blob/master/core/db.js 文件下

// 创建模型
sequelize.sync({ force: false })

改成
sequelize.sync({ force: true })

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