Comparing version 0.1.6 to 0.1.7
@@ -28,3 +28,3 @@ 'use strict'; | ||
Adapter.prototype.disconnect = function(callback) { | ||
if (callback) callback(); | ||
callback(); | ||
}; | ||
@@ -31,0 +31,0 @@ |
'use strict'; | ||
var path = require('path'), | ||
fs = require('fs'); | ||
fs = require('fs'), | ||
ProgressBar = require('progress'); | ||
@@ -217,3 +218,11 @@ /** | ||
self.adapter.connect(function(err, params) { | ||
self._migrationParams = params; | ||
self._migrationParams = params || {}; | ||
// add helpers | ||
self._migrationParams.createBar = function(total) { | ||
var bar = new ProgressBar( | ||
'[:bar] :current / :total', | ||
{total: total, width: 30, incomplete: ' '} | ||
); | ||
return bar; | ||
}; | ||
callback(err); | ||
@@ -224,3 +233,3 @@ }); | ||
Migrator.prototype.disconnect = function(callback) { | ||
this.adapter.disconnect(callback); | ||
this.adapter.disconnect(callback || noop); | ||
}; | ||
@@ -373,2 +382,4 @@ | ||
function noop() {} | ||
module.exports = Migrator; |
{ | ||
"name": "east", | ||
"description": "node.js database migration tool", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"author": "Oleg Korobenko <oleg.korobenko@gmail.com>", | ||
@@ -20,3 +20,4 @@ "repository": { | ||
"dependencies": { | ||
"commander": "1.1.1" | ||
"commander": "1.1.1", | ||
"progress": "1.1.2" | ||
}, | ||
@@ -23,0 +24,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
24802
423
2
+ Addedprogress@1.1.2
+ Addedprogress@1.1.2(transitive)