npx sequelize init:config
# created database/config.json
npx sequelize init:migrations
# created migrations folder at "database/migrations"
npx sequelize migration:generate --name=init-users
# 数据备份
npx sequelize db:migration
# 环境变量,切换数据库配置,env环境下,使用 test表
npx sequelize db:migrate --env=test
dabase数据库配置
config
config.default.js
初始化数据库
npx sequelize seed:create --name init-users
# 插入数据
npx sequelize db:seed all