Skip to content

atheken/ektorp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ektorp

Some assembly required.

Ektorp is a node.js library and command-line utility for building your CouchDB.

Project Status

Ektorp is incomplete, and is in a "stabilized state of decay". Mostly, this means that you should fork this project and enhance it for your own needs. I don't have any plans to enhance it, going forward. :-)

Using Ektorp

From the command-line:
  1. Install ektorp globally:

    $ npm install -g ektorp

  2. Run ektorp:

    $ ektorp http://localhost:5984/new_db ./migrations

  3. Relax!

From your own code:

To integrate ektorp and control more aspects of the migration:

  1. Install ektorp (doesn't need to be installed globally if you don't want to use the CLI tool):

    $ npm install ektorp

  2. Leverage ektorp in your own bootstrap script:

    var ektorp = require('ektorp');
    
    //pass the url to the DB you want to upgrade, and the path to migrations:
    var migrator = ektorp('http://localhost:5984/new_db', './migrations');
    
    migrator.on('done', function(){ console.log('Migrations are done!'); });
    
    //cause the migrator to start.
    migrator.start();
    

How do I write a migration?

Here's one way that is supported (there are others that will be documented soon):

  1. Create a directory:

    $ mkdir ./migrations

  2. Make a migration:

    $ cd ./migrations
    $ touch 201401310849_first_migration.json
    
  3. You can put a JSON array or object in 201401310849_first_migration.json, it will be pushed to the database when you run ektorp.

About

Some assembly required.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published