0.0.2 • Published 11 years ago

tiny-migrate v0.0.2

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

tiny-migrate

Naive sql migrations. Just supply a directory of versioned/numbered .sql files, and it will run them in order.

Example

var Migrate = require('tiny-migrate')
var mysql = require('mysql')

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'me',
  password : 'secret',
});

connection.connect(function(err) {
  var connection = mysql.createConnection
  var migration = Migrate(connection)
  migration
    .use('some-database') // Db will be created if it doesn't exist
    .drop() // drop db before creation
    .migrate('db/migrations') // relative path to migrations
})