mirror of
https://github.com/steedos/steedos-platform
synced 2024-11-22 17:06:42 +00:00
.. | ||
migrations | ||
migrations-bak | ||
client.js | ||
index.js | ||
package.json | ||
README.md | ||
steedos-config.yml |
Steedos Migration Scripts
Migrate steedos database with node-migrate.
Usage
DB Connection
项目根目录下执行 node 进入node控制台
在node控制台执行 require('dotenv-flow').config();
目的是为了读取.env.local设置 process.env.MONGO_URL
Migrate up
open nodejs console.
var migrate = require("@steedos/migrate");
migrate.up();
Migrate down
open nodejs console.
var migrate = require("@steedos/migrate");
migrate.down();
Default auto migrate for steedos
config STEEDOS_DB_AUTO_MIGRATE=false in .env.local to disable auto migrate
Add migration script
yarn migrate create :script_name
功能说明
- 此包用于执行升级脚本文件