steedos-platform/packages/migrate
2024-10-23 01:59:45 +00:00
..
migrations
migrations-bak
client.js
index.js
package.json action: release 2.7.10-beta.13 2024-10-23 01:59:45 +00:00
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

功能说明

  • 此包用于执行升级脚本文件