vue express sequelize base
1.0.0
>=8.4.0
和npm: >=5.3.0
>=5.7.0
对于应用程序配置,请使用带有 toml 文件的 node-config
为开发配置创建config/local-development.toml
# config/local-development.toml
env = " development "
[ db ]
username = " dbuser "
password = " dbpass "
database = " dbname "
# install dependencies
npm install
# create database table and seed with data
npm run migration
# run development server
npm run dev
# for debugging
npm run dev:inspect
Sequelize cli 用于生成迁移和播种文件
./node_modules/.bin/sequelize db:create
# Generate Task model
mkdir server/api/task
./node_modules/.bin/sequelize model:generate
--models-path server/api/task --name Task
--attributes name:STRING,description:TEXT,startAt:DATE,endAt:DATE,completedAt:DATE
./node_modules/.bin/sequelize db:migrate