NodeJS Sequelize 生成数据库表

时间:2020-07-10 11:18:15   收藏:0   阅读:229

1.创建一个数据库

2.使用 sequelize cli 初始化 项目的数据库配置信息

  ‘npx sequelize init‘

3.生成模型文件

   1.migrate文件

   2.model文件

    ‘npx sequelize model:generate --name user --attributes name:string,deadline:date,content:string‘

4.持久化到数据库

  ‘npx sequelize db:migrate‘

 

原文:https://www.cnblogs.com/feng-NET/p/13278213.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!