1.0.3 • Published 9 years ago

grunt-contrib-mongo-migrate v1.0.3

Weekly downloads
4
License
-
Repository
github
Last release
9 years ago

grunt-contrib-mongo-migrate

Build Status

Provide grunt integration for mongo-migrate node module

Installation

npm install grunt-contrib-mongo-migrate

Configuration

Add the followings to your Gruntfile.js

grunt.initConfig({
        "mongo-migrate": {
            create: "",
            up: "",
            down: "",
            options: {
                config: "config.json",
                dbPropName: "mongo"
            }
        }
    });
grunt.loadNpmTasks('grunt-contrib-mongo-migrate');

Usage

Create a migration

grunt mongo-migrate:create --name <name of migration>

Running the above task will create a migration folder and a file named 001-.js. Running this migration is as simple as

grunt mongo-migrate:up

migration:up without an argument will run all migration files to the HEAD. You can also optionally specify a specific migration to use as a ceiling.

grunt mongo-migrate:up --name 002-somefile.js

Specifying an argument means that it will stop when it reaches that file.

If you want to migrate down the syntax is the same

grunt mongo-migrate:down --name 001-somefile.js

===================================================================== This plugin is strongly inspirated by https://github.com/travism/grunt-migrate

This plugin is using https://github.com/afloyd/mongo-migrate

1.0.3

9 years ago

1.0.2

10 years ago

1.0.0

10 years ago

0.1.0

10 years ago