Socket
Book a DemoInstallSign in
Socket

tiny-migrate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-migrate

ERROR: No README.md file found!

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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
    .run(function(err) {
      console.log('Migration complete:', arguments)
    }) 
})

Keywords

mysql

FAQs

Package last updated on 15 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts