@keystone-labs/db
NPM package for db operations through Mongoose.
Last updated 5 months ago by _don .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @keystone-labs/db 
SYNC missed versions from official npm registry.

db

NPM package to perform common DB operations via Mongoose. Operations include:

  • Creating and running migrations.
  • Seeding a database.

Configuration

Environment variables.

MONGODB_URI

Database connection where migrations will be executed. you might opt to use a .env file to set this variable.

Migrations folder.

// package.json
{
...
  db: { migrationsPath: './path/where/migration/will/save' }
...
}

A folder path where migrations will be saved. If this is not specified it will create a migrations folder in the root path of the project.

commands

yarn create-migration <<migration-name>>

Create a new migration file in the folder specified by SERVER_MIGRATION_PATH. it requires a <<migration-name>>.

yarn run-migrations

Execute pending migrations (migrations that are not been run in the database).

yarn rerurn-migrations

Execute the last migration that was run.

yarn seed

Seed the database. Looks for the path to the seed file in the package.json at db.seedPath.

Current Tags

  • 2.1.2                                ...           latest (5 months ago)

5 Versions

  • 2.1.2                                ...           5 months ago
  • 2.1.1                                ...           5 months ago
  • 2.1.0                                ...           5 months ago
  • 2.0.1                                ...           5 months ago
  • 2.0.0                                ...           5 months ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 20
Dependencies (8)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |