assort
Tools for manage migration scripts.
Last updated 5 years ago by jysperm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install assort 
SYNC missed versions from official npm registry.

Assort

Tools for manage migration scripts.

Usages:

Assort = require 'assort'
assort = new Assort 'rootpanel', Assort.fromFile('.version')

Define tasks:

assort.task 'accounts', '<1.2.3', (db, callback) ->
  db.accounts.update {},
    $rename:
      name: 'username'
  ,
    multi: true
  , callback

assort.task 'database', '<=1.2.4', (db, callback) ->
  #...

The task will be run every time if version is null:

assort.task 'database', null, (db, callback) ->
  db.dropCollection 'temp_data', callback

Run migration:

assort.migrate require('./package').version, db, (err) ->

Current Tags

  • 0.1.0                                ...           latest (5 years ago)

1 Versions

  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |